Added a comment about se.info.type being used uninitialized
[ghc-hetmet.git] / rts / Task.c
index 7214725..588d414 100644 (file)
@@ -15,6 +15,7 @@
 #include "Capability.h"
 #include "Stats.h"
 #include "RtsFlags.h"
+#include "Storage.h"
 #include "Schedule.h"
 #include "Hash.h"
 #include "Trace.h"
@@ -76,11 +77,11 @@ stopTaskManager (void)
     ACQUIRE_LOCK(&sched_mutex);
     for (task = task_free_list; task != NULL; task = next) {
         next = task->next;
-        stgFree(task);
 #if defined(THREADED_RTS)
         closeCondition(&task->cond);
         closeMutex(&task->lock);
 #endif
+        stgFree(task);
     }
     task_free_list = NULL;
     RELEASE_LOCK(&sched_mutex);