diff options
author | Campbell Barton <ideasman42@gmail.com> | 2013-06-03 00:59:00 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2013-06-03 00:59:00 +0400 |
commit | 0c004723fe60fa93947d9c7ca4ec119a30a32372 (patch) | |
tree | fd438ef48fe10ddf2a17a8f929ded3edd1e05d56 /source/blender | |
parent | c5ed6765b9c46630579be5e43cab74965f0be9da (diff) |
fix [#35434] Segmentation fault switching screen layout from python
(take 2), only free popup handlers.
Diffstat (limited to 'source/blender')
-rw-r--r-- | source/blender/editors/include/UI_interface.h | 1 | ||||
-rw-r--r-- | source/blender/editors/interface/interface_handlers.c | 5 | ||||
-rw-r--r-- | source/blender/windowmanager/intern/wm_event_system.c | 5 |
3 files changed, 10 insertions, 1 deletions
diff --git a/source/blender/editors/include/UI_interface.h b/source/blender/editors/include/UI_interface.h index a602fd27222..e64a5a4af57 100644 --- a/source/blender/editors/include/UI_interface.h +++ b/source/blender/editors/include/UI_interface.h @@ -687,6 +687,7 @@ void uiScalePanels(struct ARegion *ar, float new_width); void UI_add_region_handlers(struct ListBase *handlers); void UI_add_popup_handlers(struct bContext *C, struct ListBase *handlers, uiPopupBlockHandle *popup); void UI_remove_popup_handlers(struct ListBase *handlers, uiPopupBlockHandle *popup); +void UI_remove_popup_handlers_all(struct bContext *C, struct ListBase *handlers); /* Module * diff --git a/source/blender/editors/interface/interface_handlers.c b/source/blender/editors/interface/interface_handlers.c index c5211fe9dd7..22880d8e79c 100644 --- a/source/blender/editors/interface/interface_handlers.c +++ b/source/blender/editors/interface/interface_handlers.c @@ -7662,6 +7662,11 @@ void UI_remove_popup_handlers(ListBase *handlers, uiPopupBlockHandle *popup) WM_event_remove_ui_handler(handlers, ui_handler_popup, ui_handler_remove_popup, popup, FALSE); } +void UI_remove_popup_handlers_all(bContext *C, ListBase *handlers) +{ + WM_event_free_ui_handler_all(C, handlers, ui_handler_popup, ui_handler_remove_popup); +} + bool UI_textbutton_activate_event(const bContext *C, ARegion *ar, const void *rna_poin_data, const char *rna_prop_id) { diff --git a/source/blender/windowmanager/intern/wm_event_system.c b/source/blender/windowmanager/intern/wm_event_system.c index 91b7b81940b..de961afefd8 100644 --- a/source/blender/windowmanager/intern/wm_event_system.c +++ b/source/blender/windowmanager/intern/wm_event_system.c @@ -247,7 +247,10 @@ void wm_event_do_notifiers(bContext *C) if (note->window == win) { if (note->category == NC_SCREEN) { if (note->data == ND_SCREENBROWSE) { - /* do not free handlers here! [#35434] */ + /* free popup handlers only [#35434] */ + wmWindow *win = CTX_wm_window(C); + UI_remove_popup_handlers_all(C, &win->modalhandlers); + ED_screen_set(C, note->reference); // XXX hrms, think this over! if (G.debug & G_DEBUG_EVENTS) |