diff options
author | Campbell Barton <ideasman42@gmail.com> | 2010-10-31 17:43:30 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2010-10-31 17:43:30 +0300 |
commit | 184b5fd6db4dfedb5c436ca1021bbe52df289a32 (patch) | |
tree | 469c0882950c2148086907de5ab92eca51ce3fcb /release/scripts/op/presets.py | |
parent | 391c547208184e80d1d16acb792574d9f5b63d10 (diff) |
bugfix [#24466] Selecting of object with pattern leads to strange behavior
The undo problem was caused by python operators returning 'RUNNING_MODAL' rather then the return value from wm.invoke_props_popup(self, event) - 'FINISHED'.
This was done because returning FINISHED would free the operator causing the buttons redo handler to try and run a freed operator and crash.
So the real fix is to disallow any operators to use wm.invoke_props_popup(self, event) if they dont have the REGISTER option enabled, fixing the crash and redo problem.
Diffstat (limited to 'release/scripts/op/presets.py')
-rw-r--r-- | release/scripts/op/presets.py | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/release/scripts/op/presets.py b/release/scripts/op/presets.py index 2f6a5b69c20..ec14e305c51 100644 --- a/release/scripts/op/presets.py +++ b/release/scripts/op/presets.py @@ -29,6 +29,7 @@ class AddPresetBase(): - preset_subdir ''' # bl_idname = "script.preset_base_add" # bl_label = "Add a Python Preset" + bl_options = {'REGISTER'} # only because invoke_props_popup requires. name = bpy.props.StringProperty(name="Name", description="Name of the preset, used to make the path name", maxlen=64, default="") remove_active = bpy.props.BoolProperty(default=False, options={'HIDDEN'}) @@ -110,11 +111,7 @@ class AddPresetBase(): def invoke(self, context, event): if not self.remove_active: wm = context.window_manager - #crashes, TODO - fix - #return wm.invoke_props_popup(self, event) - - wm.invoke_props_popup(self, event) - return {'RUNNING_MODAL'} + return wm.invoke_props_popup(self, event) else: return self.execute(context) |