diff options
author | Jeroen Bakker <j.bakker@atmind.nl> | 2012-09-04 15:08:47 +0400 |
---|---|---|
committer | Jeroen Bakker <j.bakker@atmind.nl> | 2012-09-04 15:08:47 +0400 |
commit | d4be0ec9fbd122e259662f8da0261798a0056430 (patch) | |
tree | b4189c11887226c958c1b13752950ccfcef5c57c /source/blender/compositor/intern/COM_WorkScheduler.cpp | |
parent | 6805db676d9d004c8131b13fca095b519997b768 (diff) |
* there is a tiny memory leak. I think it happens when you quit blenden
during a WM_draw. tiny is max 8* size of pointer and it is maintained at
that size. So no worries there.
* cleanup some code to be certain that deinitialization happens
correctly.
Diffstat (limited to 'source/blender/compositor/intern/COM_WorkScheduler.cpp')
-rw-r--r-- | source/blender/compositor/intern/COM_WorkScheduler.cpp | 26 |
1 files changed, 21 insertions, 5 deletions
diff --git a/source/blender/compositor/intern/COM_WorkScheduler.cpp b/source/blender/compositor/intern/COM_WorkScheduler.cpp index f9af23faea8..f7ae2945471 100644 --- a/source/blender/compositor/intern/COM_WorkScheduler.cpp +++ b/source/blender/compositor/intern/COM_WorkScheduler.cpp @@ -103,7 +103,13 @@ void **g_highlightedNodesRead; void COM_startReadHighlights() { - if (g_highlightedNodesRead) { + if (!g_highlightInitialized) + { + return; + } + + if (g_highlightedNodesRead) + { MEM_freeN(g_highlightedNodesRead); } @@ -114,6 +120,11 @@ void COM_startReadHighlights() int COM_isHighlightedbNode(bNode *bnode) { + if (!g_highlightInitialized) + { + return false; + } + if (!g_highlightedNodesRead) { return false; } @@ -397,13 +408,18 @@ void WorkScheduler::deinitialize() /* deinitialize highlighting */ if (g_highlightInitialized) { - if (g_highlightedNodes) + g_highlightInitialized = false; + if (g_highlightedNodes) + { MEM_freeN(g_highlightedNodes); + g_highlightedNodes = NULL; + } - if (g_highlightedNodesRead) + if (g_highlightedNodesRead) + { MEM_freeN(g_highlightedNodesRead); - - g_highlightInitialized = false; + g_highlightedNodesRead = NULL; + } } } |