fix: collect garbage when detaching for faster dc

This commit is contained in:
əlemi 2024-09-26 16:39:04 +02:00
parent 455ec025c1
commit 8a4e6e828a
Signed by: alemi
GPG key ID: A4895B84D311642C

View file

@ -165,11 +165,11 @@ local function detach(name)
id_buffer_map[buffer] = nil
buffer_id_map[name] = nil
if not CODEMP.workspace:detach(name) then
print(" /!\\ dangling reference, detach incomplete")
else
print(" -- detached from buffer " .. name)
collectgarbage("collect") -- clear dangling references
end
print(" -- detached from buffer " .. name)
require('codemp.window').update()
end