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:
authorDamien Plisson <damien.plisson@yahoo.fr>2009-12-03 15:16:00 +0300
committerDamien Plisson <damien.plisson@yahoo.fr>2009-12-03 15:16:00 +0300
commit3b1c6d6065ea784e6986bff58a842afd0915dc7a (patch)
treedd0716174c9a7147bb513586739fc95bb7787106 /source/blender/quicktime
parent1fd581ad77e2958e4ea7a6faf0afd823d26f042c (diff)
Quicktime Carbon: Fix memory leak when build with cocoa
Diffstat (limited to 'source/blender/quicktime')
-rw-r--r--source/blender/quicktime/SConscript7
-rw-r--r--source/blender/quicktime/apple/quicktime_export.c19
2 files changed, 23 insertions, 3 deletions
diff --git a/source/blender/quicktime/SConscript b/source/blender/quicktime/SConscript
index 549b3cffe5a..c8cd795decb 100644
--- a/source/blender/quicktime/SConscript
+++ b/source/blender/quicktime/SConscript
@@ -30,4 +30,9 @@ incs.append(env['BF_QUICKTIME_INC'])
types = ['core','player']
priorities = [200,235]
-env.BlenderLib ('bf_quicktime', sources=source_files, includes=incs, defines=['WITH_QUICKTIME'], libtype=types, priority=priorities)
+defs=['WITH_QUICKTIME']
+
+if env['WITH_GHOST_COCOA']:
+ defs.append('GHOST_COCOA')
+
+env.BlenderLib ('bf_quicktime', sources=source_files, includes=incs, defines=defs, libtype=types, priority=priorities)
diff --git a/source/blender/quicktime/apple/quicktime_export.c b/source/blender/quicktime/apple/quicktime_export.c
index dea170ddeb4..68fd60d89d2 100644
--- a/source/blender/quicktime/apple/quicktime_export.c
+++ b/source/blender/quicktime/apple/quicktime_export.c
@@ -783,7 +783,7 @@ static int request_qtcodec_settings(bContext *C, wmOperator *op)
err = SCRequestSequenceSettings(qtdata->theComponent);
if (err == scUserCancelled) {
- return 0;
+ return OPERATOR_FINISHED;
}
// update runtime codecsettings for use with the codec dialog
@@ -844,7 +844,7 @@ static int request_qtcodec_settings(bContext *C, wmOperator *op)
}
}
- return 1;
+ return OPERATOR_FINISHED;
}
static int ED_operator_setqtcodec(bContext *C)
@@ -852,6 +852,17 @@ static int ED_operator_setqtcodec(bContext *C)
return G.have_quicktime != FALSE;
}
+#if defined(__APPLE__) && defined(GHOST_COCOA)
+//Need to set up a Cocoa NSAutoReleasePool to avoid memory leak
+//And it must be done in an objC file, so use a GHOST_SystemCocoa.mm function for that
+extern int cocoa_request_qtcodec_settings(bContext *C, wmOperator *op);
+
+int fromcocoa_request_qtcodec_settings(bContext *C, wmOperator *op)
+{
+ return request_qtcodec_settings(C, op);
+}
+#endif
+
void SCENE_OT_render_data_set_quicktime_codec(wmOperatorType *ot)
{
@@ -861,7 +872,11 @@ void SCENE_OT_render_data_set_quicktime_codec(wmOperatorType *ot)
ot->idname= "SCENE_OT_render_data_set_quicktime_codec";
/* api callbacks */
+#if defined(__APPLE__) && defined(GHOST_COCOA)
+ ot->exec = cocoa_request_qtcodec_settings;
+#else
ot->exec= request_qtcodec_settings;
+#endif
ot->poll= ED_operator_setqtcodec;
/* flags */