Skip to content

Commit

Permalink
fix(memory): dereference global callbacks correctly
Browse files Browse the repository at this point in the history
  • Loading branch information
bekaboo committed Nov 1, 2023
1 parent 0242c97 commit 3435bb8
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions lua/dropbar.lua
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@ local function setup(opts)
callback = function(info)
utils.bar.exec('del', { buf = info.buf })
_G.dropbar.bars[info.buf] = nil
_G.dropbar.on_click_callbacks['buf' .. info.buf] = nil
end,
desc = 'Remove dropbar from cache on buffer delete/unload/wipeout.',
})
Expand Down
2 changes: 1 addition & 1 deletion lua/dropbar/bar.lua
Original file line number Diff line number Diff line change
Expand Up @@ -408,7 +408,7 @@ end
---@return nil
function dropbar_t:del()
_G.dropbar.bars[self.buf][self.win] = nil
_G.dropbar.on_click_callbacks[self.buf][self.win] = nil
_G.dropbar.on_click_callbacks['buf' .. self.buf]['win' .. self.win] = nil
for _, component in ipairs(self.components) do
component:del()
end
Expand Down

0 comments on commit 3435bb8

Please sign in to comment.