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:
authorJulian Eisel <eiseljulian@gmail.com>2016-11-10 21:56:52 +0300
committerJulian Eisel <eiseljulian@gmail.com>2016-11-10 22:34:35 +0300
commit82ba89b042e7067d989daa0fcb414bdc9e31c276 (patch)
tree645a52b54bb694c7745e69fd308ea19725695330 /source/blender/windowmanager
parent69655a1103bccdee7e39c7f0a6772c8178947992 (diff)
Fix T49961: Blender 2.8 Crashes on saving an image
Caused by 4811b2d3565cf which caused the event handler hack that is used to fire up the file browser from other operators to fail. Basically the context from before the file browser is opened gets stored and used later for executing the actual file read/write operation (in this case, saving image). This context storage is cleared when exiting an editor since 4811b2d3565cf, which is technically correct, but causes usage of NULLed context data in this case, because the file browser is exited before the file read/write operation is executed. For now I solved this by moving the fileselect handler to list of normal handlers, instead of modal ones. 4811b2d3565cf only touches list of modal handlers so we avoid the crash. Ideally we'd completely refactor how the file browser opening works to get rid of these event handler hacks. Note that I wouldn't be suprised if this causes other regressions, but I couldn't find one so worth a try.
Diffstat (limited to 'source/blender/windowmanager')
-rw-r--r--source/blender/windowmanager/intern/wm_event_system.c8
-rw-r--r--source/blender/windowmanager/wm_event_system.h2
2 files changed, 5 insertions, 5 deletions
diff --git a/source/blender/windowmanager/intern/wm_event_system.c b/source/blender/windowmanager/intern/wm_event_system.c
index b15b47c8edc..cadc3ac8b6e 100644
--- a/source/blender/windowmanager/intern/wm_event_system.c
+++ b/source/blender/windowmanager/intern/wm_event_system.c
@@ -2641,7 +2641,7 @@ void WM_event_add_fileselect(bContext *C, wmOperator *op)
wmWindow *win = CTX_wm_window(C);
/* only allow 1 file selector open per window */
- for (handler = win->modalhandlers.first; handler; handler = handlernext) {
+ for (handler = win->handlers.first; handler; handler = handlernext) {
handlernext = handler->next;
if (handler->type == WM_HANDLER_FILESELECT) {
@@ -2655,7 +2655,7 @@ void WM_event_add_fileselect(bContext *C, wmOperator *op)
if (sfile->op == handler->op) {
CTX_wm_area_set(C, sa);
- wm_handler_fileselect_do(C, &win->modalhandlers, handler, EVT_FILESELECT_CANCEL);
+ wm_handler_fileselect_do(C, &win->handlers, handler, EVT_FILESELECT_CANCEL);
break;
}
}
@@ -2663,7 +2663,7 @@ void WM_event_add_fileselect(bContext *C, wmOperator *op)
/* if not found we stop the handler without changing the screen */
if (!sa)
- wm_handler_fileselect_do(C, &win->modalhandlers, handler, EVT_FILESELECT_EXTERNAL_CANCEL);
+ wm_handler_fileselect_do(C, &win->handlers, handler, EVT_FILESELECT_EXTERNAL_CANCEL);
}
}
@@ -2674,7 +2674,7 @@ void WM_event_add_fileselect(bContext *C, wmOperator *op)
handler->op_area = CTX_wm_area(C);
handler->op_region = CTX_wm_region(C);
- BLI_addhead(&win->modalhandlers, handler);
+ BLI_addhead(&win->handlers, handler);
/* check props once before invoking if check is available
* ensures initial properties are valid */
diff --git a/source/blender/windowmanager/wm_event_system.h b/source/blender/windowmanager/wm_event_system.h
index abab7c55f44..2f7ebbc1def 100644
--- a/source/blender/windowmanager/wm_event_system.h
+++ b/source/blender/windowmanager/wm_event_system.h
@@ -52,7 +52,7 @@ typedef struct wmEventHandler {
wmKeyMap *keymap; /* pointer to builtin/custom keymaps */
const rcti *bblocal, *bbwin; /* optional local and windowspace bb */
- /* modal operator handler */
+ /* modal operator handler and WM_HANDLER_FILESELECT */
wmOperator *op; /* for derived/modal handlers */
struct ScrArea *op_area; /* for derived/modal handlers */
struct ARegion *op_region; /* for derived/modal handlers */