auto merge of #608 : kmcallister/servo/script-exit, r=metajack

This commit is contained in:
bors-servo 2013-07-22 13:33:20 -07:00
commit 25fdcb3dca
3 changed files with 10 additions and 13 deletions

View file

@ -254,12 +254,10 @@ impl Constellation {
// Don't navigate on Navigate type, because that is handled by forward/back // Don't navigate on Navigate type, because that is handled by forward/back
match pipeline.navigation_type.get() { match pipeline.navigation_type.get() {
constellation_msg::Load => { constellation_msg::Load => {
let _evicted = self.navigation_context.navigate(id); let evicted = self.navigation_context.navigate(id);
/* FIXME(tkuehn): the following code causes a segfault
for evicted.iter().advance |id| { for evicted.iter().advance |id| {
self.pipelines.get(id).exit(); self.pipelines.get(id).exit();
} }
*/
} }
_ => {} _ => {}
} }

View file

@ -223,6 +223,10 @@ impl<'self, View> AbstractNode<View> {
/// Sets the layout data, unsafely casting the type as layout wishes. Only layout is allowed /// Sets the layout data, unsafely casting the type as layout wishes. Only layout is allowed
/// to call this. This is wildly unsafe and is therefore marked as such. /// to call this. This is wildly unsafe and is therefore marked as such.
pub unsafe fn unsafe_set_layout_data<T>(self, data: @mut T) { pub unsafe fn unsafe_set_layout_data<T>(self, data: @mut T) {
// Don't decrement the refcount on data, since we're giving it to the
// base structure.
cast::forget(data);
do self.with_mut_base |base| { do self.with_mut_base |base| {
base.layout_data = Some(transmute(data)) base.layout_data = Some(transmute(data))
} }

View file

@ -167,15 +167,6 @@ pub fn task_from_context(js_context: *JSContext) -> *mut ScriptTask {
} }
} }
#[unsafe_destructor]
impl Drop for ScriptTask {
fn drop(&self) {
unsafe {
let _ = local_data::local_data_pop(global_script_context_key);
}
}
}
impl ScriptTask { impl ScriptTask {
/// Creates a new script task. /// Creates a new script task.
pub fn new(id: uint, pub fn new(id: uint,
@ -362,7 +353,11 @@ impl ScriptTask {
frame.document.teardown(); frame.document.teardown();
} }
self.layout_chan.send(layout_interface::ExitMsg) self.layout_chan.send(layout_interface::ExitMsg);
unsafe {
let _ = local_data::local_data_pop(global_script_context_key);
}
} }
/// The entry point to document loading. Defines bindings, sets up the window and document /// The entry point to document loading. Defines bindings, sets up the window and document