diff options
author | Campbell Barton <ideasman42@gmail.com> | 2010-02-27 17:44:46 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2010-02-27 17:44:46 +0300 |
commit | ddacff06f287a849b88b498d5efcab90253e49c3 (patch) | |
tree | 9ad9e0d1226be307f6444fe08df9ba2e60aafaec /source/blender/windowmanager/intern/wm.c | |
parent | b6acf0bb48e8d8e606a7b4b9c0d96337091c0bd4 (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.c | 7 |
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); |