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:
authorCampbell Barton <ideasman42@gmail.com>2010-02-27 17:44:46 +0300
committerCampbell Barton <ideasman42@gmail.com>2010-02-27 17:44:46 +0300
commitddacff06f287a849b88b498d5efcab90253e49c3 (patch)
tree9ad9e0d1226be307f6444fe08df9ba2e60aafaec /source/blender/windowmanager/intern/wm.c
parentb6acf0bb48e8d8e606a7b4b9c0d96337091c0bd4 (diff)
hold the python operator instance in the operator, otherwise the handelers need to be stored in the operator type or in the module which isnt nice for modal operators.
Diffstat (limited to 'source/blender/windowmanager/intern/wm.c')
-rw-r--r--source/blender/windowmanager/intern/wm.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/source/blender/windowmanager/intern/wm.c b/source/blender/windowmanager/intern/wm.c
index e2b2c17beee..048487fcd68 100644
--- a/source/blender/windowmanager/intern/wm.c
+++ b/source/blender/windowmanager/intern/wm.c
@@ -54,6 +54,7 @@
#include "wm.h"
#include "ED_screen.h"
+#include "BPY_extern.h"
#include "RNA_types.h"
@@ -63,6 +64,12 @@
void WM_operator_free(wmOperator *op)
{
+ if(op->py_instance) {
+ /* do this first incase there are any __del__ functions or
+ * similar that use properties */
+ BPY_DECREF(op->py_instance);
+ }
+
if(op->ptr) {
op->properties= op->ptr->data;
MEM_freeN(op->ptr);