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:
Diffstat (limited to 'source/blender/editors/space_buttons/space_buttons.c')
-rw-r--r--source/blender/editors/space_buttons/space_buttons.c13
1 files changed, 11 insertions, 2 deletions
diff --git a/source/blender/editors/space_buttons/space_buttons.c b/source/blender/editors/space_buttons/space_buttons.c
index 6ac3201c5f1..147c3175d33 100644
--- a/source/blender/editors/space_buttons/space_buttons.c
+++ b/source/blender/editors/space_buttons/space_buttons.c
@@ -109,21 +109,30 @@ static void buttons_free(SpaceLink *sl)
BLI_freelistN(&ct->users);
MEM_freeN(ct);
}
+
+ BLI_assert(sbuts->runtime != NULL);
+ MEM_freeN(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;
+
+ 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.search_string[0] = '\0';
+ sbutsn->runtime = MEM_dupallocN(sfile_old->runtime);
+ sbutsn->runtime->search_string[0] = '\0';
return (SpaceLink *)sbutsn;
}