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:
authorSergey Sharybin <sergey.vfx@gmail.com>2012-05-26 13:49:54 +0400
committerSergey Sharybin <sergey.vfx@gmail.com>2012-05-26 13:49:54 +0400
commit3cb166e0f2ee04d0ab24ac4700b852e32f24cb8a (patch)
tree7d808e17d7f4845857f89fcb7424f91f63abaf8c /source/blender/editors
parentc895c0ee2356cd9901e26d8a96fc40e5aac63c16 (diff)
Fix reading freed memory when opening file by click on it on splash screen
Issue was introduced by yesterday's commit 47021 and caused by some handler's which is getting called from ui_handler_popup frees event. Worked around a bit by storing return value for ui_handler_popup before running other handlers, but this only means global refactor of even handling order is getting closer and closer.
Diffstat (limited to 'source/blender/editors')
-rw-r--r--source/blender/editors/interface/interface_handlers.c24
1 files changed, 13 insertions, 11 deletions
diff --git a/source/blender/editors/interface/interface_handlers.c b/source/blender/editors/interface/interface_handlers.c
index 58dfabd99ce..91e6b3d0590 100644
--- a/source/blender/editors/interface/interface_handlers.c
+++ b/source/blender/editors/interface/interface_handlers.c
@@ -6546,6 +6546,18 @@ static int ui_handler_popup(bContext *C, wmEvent *event, void *userdata)
{
uiPopupBlockHandle *menu = userdata;
+ /* we block all events, this is modal interaction, except for drop events which is described below */
+ int retval = WM_UI_HANDLER_BREAK;
+
+ if (event->type == EVT_DROP) {
+ /* if we're handling drop event we'll want it to be handled by popup callee as well,
+ * so it'll be possible to perform such operations as opening .blend files by dropping
+ * them into blender even if there's opened popup like splash screen (sergey)
+ */
+
+ retval = WM_UI_HANDLER_CONTINUE;
+ }
+
ui_handle_menus_recursive(C, event, menu);
/* free if done, does not free handle itself */
@@ -6574,17 +6586,7 @@ static int ui_handler_popup(bContext *C, wmEvent *event, void *userdata)
/* delayed apply callbacks */
ui_apply_but_funcs_after(C);
- if (event->type == EVT_DROP) {
- /* if we're handling drop event we'll want it to be handled by popup callee as well,
- * so it'll be possible to perform such operations as opening .blend files by dropping
- * them into blender even if there's opened popup like splash screen (sergey)
- */
-
- return WM_UI_HANDLER_CONTINUE;
- }
-
- /* we block all events, this is modal interaction, except for drop events which is described above */
- return WM_UI_HANDLER_BREAK;
+ return retval;
}
static void ui_handler_remove_popup(bContext *C, void *userdata)