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
path: root/source
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2021-04-11 05:14:42 +0300
committerCampbell Barton <ideasman42@gmail.com>2021-04-11 05:14:42 +0300
commit947ba0d27bf58b3efdae9617cb87a3dba0dbc0dd (patch)
treeb033a6ff727414e09cb1ae96e229ce4dc81ea4a7 /source
parent0e3bc2e3210dae253dc6fee47fcec4ce2502887a (diff)
Fix T87355: Crash using menu search from the top bar
Menu search used an area with a NULL data pointer, replace this with a dummy pointer. Caused by 3f3b4745b6ad99a0503fba4793d0f1febedadebc.
Diffstat (limited to 'source')
-rw-r--r--source/blender/editors/interface/interface_template_search_menu.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/source/blender/editors/interface/interface_template_search_menu.c b/source/blender/editors/interface/interface_template_search_menu.c
index ff42d434f29..df19bdb650e 100644
--- a/source/blender/editors/interface/interface_template_search_menu.c
+++ b/source/blender/editors/interface/interface_template_search_menu.c
@@ -510,11 +510,19 @@ static struct MenuSearch_Data *menu_items_from_ui_create(
const char *global_menu_prefix = NULL;
if (include_all_areas) {
+ bScreen *screen = WM_window_get_active_screen(win);
+
/* First create arrays for ui_type. */
PropertyRNA *prop_ui_type = NULL;
{
+ /* This must be a valid pointer, with only it's type checked. */
+ ScrArea area_dummy = {
+ /* Anything besides #SPACE_EMPTY is fine,
+ * as this value is only included in the enum when set. */
+ .spacetype = SPACE_TOPBAR,
+ };
PointerRNA ptr;
- RNA_pointer_create(NULL, &RNA_Area, NULL, &ptr);
+ RNA_pointer_create(&screen->id, &RNA_Area, &area_dummy, &ptr);
prop_ui_type = RNA_struct_find_property(&ptr, "ui_type");
RNA_property_enum_items(C,
&ptr,
@@ -529,7 +537,6 @@ static struct MenuSearch_Data *menu_items_from_ui_create(
}
}
- bScreen *screen = WM_window_get_active_screen(win);
LISTBASE_FOREACH (ScrArea *, area, &screen->areabase) {
ARegion *region = BKE_area_find_region_type(area, RGN_TYPE_WINDOW);
if (region != NULL) {