Tool System: per space/mode tool support
[blender.git] / source / blender / blenkernel / intern / workspace.c
index 38378f66584fe956f3aff5fc7a20ee6b6b1fb99f..fd316cb9d821a4904e28f82cb09b1c177064b315 100644 (file)
@@ -171,6 +171,14 @@ void BKE_workspace_free(WorkSpace *workspace)
 
        BLI_freelistN(&workspace->owner_ids);
        BLI_freelistN(&workspace->layouts);
+
+       for (bToolRef *tref = workspace->tools.first, *tref_next; tref; tref = tref_next) {
+               tref_next = tref->next;
+               if (tref->runtime) {
+                       MEM_freeN(tref->runtime);
+               }
+       }
+       BLI_freelistN(&workspace->tools);
 }
 
 /**