about summary refs log tree commit diff
path: root/src/rt/rust_kernel.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/rt/rust_kernel.cpp')
-rw-r--r--src/rt/rust_kernel.cpp5
1 files changed, 1 insertions, 4 deletions
diff --git a/src/rt/rust_kernel.cpp b/src/rt/rust_kernel.cpp
index 004e42a8138..8f41182d791 100644
--- a/src/rt/rust_kernel.cpp
+++ b/src/rt/rust_kernel.cpp
@@ -21,10 +21,6 @@ rust_kernel::rust_kernel(rust_srv *srv, size_t num_threads) :
     live_schedulers = 1;
 }
 
-rust_kernel::~rust_kernel() {
-    delete sched;
-}
-
 void
 rust_kernel::log(uint32_t level, char const *fmt, ...) {
     char buf[BUF_BYTES];
@@ -83,6 +79,7 @@ void
 rust_kernel::release_scheduler() {
     I(this, !sched_lock.lock_held_by_current_thread());
     scoped_lock with(sched_lock);
+    delete sched;
     --live_schedulers;
     if (live_schedulers == 0) {
         // We're all done. Tell the main thread to continue