about summary refs log tree commit diff
path: root/src/libnative/lib.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/libnative/lib.rs')
-rw-r--r--src/libnative/lib.rs5
1 files changed, 2 insertions, 3 deletions
diff --git a/src/libnative/lib.rs b/src/libnative/lib.rs
index 3438661ffb3..9b2bcbbdb0e 100644
--- a/src/libnative/lib.rs
+++ b/src/libnative/lib.rs
@@ -134,13 +134,12 @@ pub fn start(argc: int, argv: **u8, main: proc()) -> int {
     let mut main = Some(main);
     let mut task = task::new((my_stack_bottom, my_stack_top));
     task.name = Some(str::Slice("<main>"));
-    let t = task.run(|| {
+    drop(task.run(|| {
         unsafe {
             rt::stack::record_stack_bounds(my_stack_bottom, my_stack_top);
         }
         exit_code = Some(run(main.take_unwrap()));
-    });
-    drop(t);
+    }).destroy());
     unsafe { rt::cleanup(); }
     // If the exit code wasn't set, then the task block must have failed.
     return exit_code.unwrap_or(rt::DEFAULT_ERROR_CODE);