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>2012-08-01 02:15:54 +0400
committerCampbell Barton <ideasman42@gmail.com>2012-08-01 02:15:54 +0400
commita70a48814e16ffd063231577e1a120e1c2629675 (patch)
tree2a410e50ca8236c0c8cdc002cb100287fd3f622e /source/blender/windowmanager
parent872ebc731038c0465a21de92bedad33b771c9b4b (diff)
fix [#32232] Running script that changes area.type crashes blender.
(reported the bug to keep some reference to the script that crashes).
Diffstat (limited to 'source/blender/windowmanager')
-rw-r--r--source/blender/windowmanager/intern/wm_event_system.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/source/blender/windowmanager/intern/wm_event_system.c b/source/blender/windowmanager/intern/wm_event_system.c
index aa970f6391a..231150557cb 100644
--- a/source/blender/windowmanager/intern/wm_event_system.c
+++ b/source/blender/windowmanager/intern/wm_event_system.c
@@ -1683,9 +1683,14 @@ static int wm_handlers_do(bContext *C, wmEvent *event, ListBase *handlers)
}
#endif
- /* modal handlers can get removed in this loop, we keep the loop this way */
- for (handler = handlers->first; handler; handler = nexthandler) {
-
+ /* modal handlers can get removed in this loop, we keep the loop this way
+ *
+ * note: check 'handlers->first' because in rare cases the handlers can be cleared
+ * by the event thats called, for eg:
+ *
+ * Calling a python script which changes the area.type, see [#32232] */
+ for (handler = handlers->first; handler && handlers->first; handler = nexthandler) {
+
nexthandler = handler->next;
/* during this loop, ui handlers for nested menus can tag multiple handlers free */