From ddacff06f287a849b88b498d5efcab90253e49c3 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Sat, 27 Feb 2010 14:44:46 +0000 Subject: 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. --- source/blender/windowmanager/intern/wm.c | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'source/blender/windowmanager/intern/wm.c') 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); -- cgit v1.2.3