Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeroen Bakker <j.bakker@atmind.nl>2012-09-04 15:08:47 +0400
committerJeroen Bakker <j.bakker@atmind.nl>2012-09-04 15:08:47 +0400
commitd4be0ec9fbd122e259662f8da0261798a0056430 (patch)
treeb4189c11887226c958c1b13752950ccfcef5c57c /source/blender/compositor/intern/COM_compositor.cpp
parent6805db676d9d004c8131b13fca095b519997b768 (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_compositor.cpp')
-rw-r--r--source/blender/compositor/intern/COM_compositor.cpp19
1 files changed, 16 insertions, 3 deletions
diff --git a/source/blender/compositor/intern/COM_compositor.cpp b/source/blender/compositor/intern/COM_compositor.cpp
index daf48d65caf..6369eff3048 100644
--- a/source/blender/compositor/intern/COM_compositor.cpp
+++ b/source/blender/compositor/intern/COM_compositor.cpp
@@ -37,6 +37,11 @@ extern "C" {
static ThreadMutex s_compositorMutex;
static char is_compositorMutex_init = FALSE;
+void intern_freeCompositorCaches()
+{
+ deintializeDistortionCache();
+}
+
void COM_execute(RenderData *rd, bNodeTree *editingtree, int rendering)
{
/* initialize mutex, TODO this mutex init is actually not thread safe and
@@ -86,14 +91,22 @@ void COM_execute(RenderData *rd, bNodeTree *editingtree, int rendering)
BLI_mutex_unlock(&s_compositorMutex);
}
+void COM_freeCaches()
+{
+ if (is_compositorMutex_init)
+ {
+ BLI_mutex_lock(&s_compositorMutex);
+ intern_freeCompositorCaches();
+ BLI_mutex_unlock(&s_compositorMutex);
+ }
+}
+
void COM_deinitialize()
{
if (is_compositorMutex_init) {
BLI_mutex_lock(&s_compositorMutex);
-
- deintializeDistortionCache();
+ intern_freeCompositorCaches();
WorkScheduler::deinitialize();
-
is_compositorMutex_init = FALSE;
BLI_mutex_unlock(&s_compositorMutex);
BLI_mutex_end(&s_compositorMutex);