mirror of
https://github.com/neovim/neovim.git
synced 2025-09-06 19:38:20 +00:00
fix(tabline): avoid memory leak in tabline click definitions (#21847)
Problem: Memory is leaked in tabline click definitions since https://github.com/neovim/neovim/pull/21008. Solution: Add back a call to `stl_clear_click_defs()` that was lost in the refactor PR.
This commit is contained in:
@@ -733,6 +733,10 @@ void draw_tabline(void)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Clear tab_page_click_defs: Clicking outside of tabs has no effect.
|
||||||
|
assert(tab_page_click_defs_size >= (size_t)Columns);
|
||||||
|
stl_clear_click_defs(tab_page_click_defs, tab_page_click_defs_size);
|
||||||
|
|
||||||
// Use the 'tabline' option if it's set.
|
// Use the 'tabline' option if it's set.
|
||||||
if (*p_tal != NUL) {
|
if (*p_tal != NUL) {
|
||||||
win_redr_custom(NULL, false, false);
|
win_redr_custom(NULL, false, false);
|
||||||
|
@@ -119,4 +119,10 @@ describe("tabline", function()
|
|||||||
[2] = {bold = true, foreground = Screen.colors.Blue};
|
[2] = {bold = true, foreground = Screen.colors.Blue};
|
||||||
}}
|
}}
|
||||||
end)
|
end)
|
||||||
|
|
||||||
|
it('click definitions do not leak memory #21765', function()
|
||||||
|
command('set tabline=%@MyClickFunc@MyClickText%T')
|
||||||
|
command('set showtabline=2')
|
||||||
|
command('redrawtabline')
|
||||||
|
end)
|
||||||
end)
|
end)
|
||||||
|
Reference in New Issue
Block a user