diff options
author | bors-servo <metajack+bors@gmail.com> | 2015-03-23 13:39:53 -0600 |
---|---|---|
committer | bors-servo <metajack+bors@gmail.com> | 2015-03-23 13:39:53 -0600 |
commit | 5ce7d8accfc52dd37b19b4400a643a980412bb2f (patch) | |
tree | e882f7262dbfe614db4b1cb0dbd9b3a9e17247f2 /components/script/script_task.rs | |
parent | b1a35f549baad871a3691ae485af2efecd2d73f7 (diff) | |
parent | 48b151948f9eaa1ad732363bf46bb0c4b9719832 (diff) | |
download | servo-5ce7d8accfc52dd37b19b4400a643a980412bb2f.tar.gz servo-5ce7d8accfc52dd37b19b4400a643a980412bb2f.zip |
auto merge of #5327 : Ms2ger/servo/memory-explosion, r=Ms2ger
Diffstat (limited to 'components/script/script_task.rs')
-rw-r--r-- | components/script/script_task.rs | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/components/script/script_task.rs b/components/script/script_task.rs index b66de84bc5c..c66a0a424a3 100644 --- a/components/script/script_task.rs +++ b/components/script/script_task.rs @@ -25,7 +25,7 @@ use dom::bindings::codegen::InheritTypes::{ElementCast, EventTargetCast, HTMLIFr use dom::bindings::conversions::FromJSValConvertible; use dom::bindings::conversions::StringificationBehavior; use dom::bindings::js::{JS, JSRef, Temporary, OptionalRootable, RootedReference}; -use dom::bindings::js::{RootCollection, RootCollectionPtr}; +use dom::bindings::js::{RootCollection, RootCollectionPtr, Unrooted}; use dom::bindings::refcounted::{LiveDOMReferences, Trusted, TrustedReference}; use dom::bindings::structuredclone::StructuredCloneData; use dom::bindings::trace::JSTraceable; @@ -303,14 +303,15 @@ impl<'a> ScriptMemoryFailsafe<'a> { #[unsafe_destructor] impl<'a> Drop for ScriptMemoryFailsafe<'a> { + #[allow(unrooted_must_root)] fn drop(&mut self) { match self.owner { Some(owner) => { unsafe { let page = owner.page.borrow_for_script_deallocation(); for page in page.iter() { - let window = page.window().root(); - window.r().clear_js_context_for_script_deallocation(); + let window = Unrooted::from_temporary(page.window()); + (*window.unsafe_get()).clear_js_context_for_script_deallocation(); } *owner.js_context.borrow_for_script_deallocation() = None; } |