about summary refs log tree commit diff
path: root/src/rt/rust_task.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/rt/rust_task.cpp')
-rw-r--r--src/rt/rust_task.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/rt/rust_task.cpp b/src/rt/rust_task.cpp
index 3933692f015..6c79ef3264a 100644
--- a/src/rt/rust_task.cpp
+++ b/src/rt/rust_task.cpp
@@ -178,7 +178,10 @@ rust_task::~rust_task()
     I(sched, ref_count == 0); // ||
     //   (ref_count == 1 && this == sched->root_task));
 
-    del_stk(this, stk);
+    // Delete all the stacks. There may be more than one if the task failed
+    while (stk != NULL) {
+        del_stk(this, stk);
+    }
 }
 
 struct spawn_args {