if thread panics then assertion for PendingLoadGuard destructor is not

run
This commit is contained in:
r0e 2015-05-21 17:19:26 -07:00
parent dbb21a90d9
commit 4e327d6941

View file

@ -26,6 +26,7 @@ use msg::constellation_msg::{PipelineId};
use url::Url;
use std::sync::mpsc::{channel, Receiver, Sender};
use std::thread;
pub mod image_cache_task;
pub mod storage_task;
@ -147,9 +148,11 @@ impl PendingLoadGuard {
impl Drop for PendingLoadGuard {
fn drop(&mut self) {
if !thread::panicking() {
assert!(self.loaded)
}
}
}
impl PendingAsyncLoad {
pub fn new(resource_task: ResourceTask, url: Url, pipeline: Option<PipelineId>)