diff options
Diffstat (limited to 'source/blender/editors/space_buttons/space_buttons.c')
-rw-r--r-- | source/blender/editors/space_buttons/space_buttons.c | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/source/blender/editors/space_buttons/space_buttons.c b/source/blender/editors/space_buttons/space_buttons.c index 25f8fecbf26..59723fb1926 100644 --- a/source/blender/editors/space_buttons/space_buttons.c +++ b/source/blender/editors/space_buttons/space_buttons.c @@ -109,20 +109,31 @@ static void buttons_free(SpaceLink *sl) BLI_freelistN(&ct->users); MEM_freeN(ct); } + + MEM_SAFE_FREE(sbuts->runtime); } /* spacetype; init callback */ -static void buttons_init(struct wmWindowManager *UNUSED(wm), ScrArea *UNUSED(area)) +static void buttons_init(struct wmWindowManager *UNUSED(wm), ScrArea *area) { + SpaceProperties *sbuts = (SpaceProperties *)area->spacedata.first; + + if (sbuts->runtime == NULL) { + sbuts->runtime = MEM_mallocN(sizeof(SpaceProperties_Runtime), __func__); + sbuts->runtime->search_string[0] = '\0'; + } } static SpaceLink *buttons_duplicate(SpaceLink *sl) { + SpaceProperties *sfile_old = (SpaceProperties *)sl; SpaceProperties *sbutsn = MEM_dupallocN(sl); /* clear or remove stuff from old */ sbutsn->path = NULL; sbutsn->texuser = NULL; + sbutsn->runtime = MEM_dupallocN(sfile_old->runtime); + sbutsn->runtime->search_string[0] = '\0'; return (SpaceLink *)sbutsn; } |