:destroy fix for frame's with childrens with reactive properties

This commit is contained in:
Robert Jelic
2025-04-19 06:19:02 +02:00
parent 32ecbc2883
commit 90911ebf91
3 changed files with 16 additions and 7 deletions

View File

@@ -1,5 +1,6 @@
local PropertySystem = require("propertySystem")
local uuid = require("libraries/utils").uuid
local errorManager = require("errorManager")
---@configDescription The base class for all UI elements in Basalt.
--- The base class for all UI elements in Basalt. This class provides basic properties and event handling functionality.
@@ -252,6 +253,9 @@ end
--- Destroys the element and cleans up all references
--- @shortDescription Destroys the element and cleans up all references
function BaseElement:destroy()
self._destroyed = true
self:removeAllObservers()
self:setFocused(false)
for event in pairs(self._registeredEvents) do
self:listenEvent(event, false)
end