diff options
author | Hans Goudey <h.goudey@me.com> | 2020-09-02 01:29:17 +0300 |
---|---|---|
committer | Hans Goudey <h.goudey@me.com> | 2020-09-02 01:29:17 +0300 |
commit | ba188e7218994c250c30040670fb96e70f91dc80 (patch) | |
tree | 9d9ac1e8e42446bba3db717bc0b5c846d6c918d3 /source/blender/editors/interface/interface_panel.c | |
parent | f6ab6dd91ae369a030ac55c492e65bacb2ec430a (diff) |
UI: Remove unecessary panel_free_block function
This function was called when the modifier list changes and the panel
list has to be rebuilt. Originally I thought it was necessary to to remove
the block immediately when the panel was removed, but we can just
leave it and it will be removed later in the UI drawing process.
Removing this results in fewer string lookups.
Diffstat (limited to 'source/blender/editors/interface/interface_panel.c')
-rw-r--r-- | source/blender/editors/interface/interface_panel.c | 25 |
1 files changed, 0 insertions, 25 deletions
diff --git a/source/blender/editors/interface/interface_panel.c b/source/blender/editors/interface/interface_panel.c index ade77e96bf9..bc38e177cea 100644 --- a/source/blender/editors/interface/interface_panel.c +++ b/source/blender/editors/interface/interface_panel.c @@ -288,29 +288,6 @@ void UI_list_panel_unique_str(Panel *panel, char *r_name) } /** - * Remove the #uiBlock corresponding to a panel. The lookup is needed because panels don't store - * a reference to their corresponding #uiBlock. - */ -static void panel_free_block(const bContext *C, ARegion *region, Panel *panel) -{ - BLI_assert(panel->type); - - char block_name[BKE_ST_MAXNAME + LIST_PANEL_UNIQUE_STR_LEN]; - strncpy(block_name, panel->type->idname, BKE_ST_MAXNAME); - char unique_panel_str[LIST_PANEL_UNIQUE_STR_LEN]; - UI_list_panel_unique_str(panel, unique_panel_str); - strncat(block_name, unique_panel_str, LIST_PANEL_UNIQUE_STR_LEN); - - LISTBASE_FOREACH (uiBlock *, block, ®ion->uiblocks) { - if (STREQ(block->name, block_name)) { - BLI_remlink(®ion->uiblocks, block); - UI_block_free(C, block); - break; /* Only delete one block for this panel. */ - } - } -} - -/** * Free a panel and it's children. Custom data is shared by the panel and its children * and is freed by #UI_panels_free_instanced. * @@ -325,8 +302,6 @@ static void panel_delete(const bContext *C, ARegion *region, ListBase *panels, P } BLI_freelistN(&panel->children); - panel_free_block(C, region, panel); - BLI_remlink(panels, panel); if (panel->activedata) { MEM_freeN(panel->activedata); |