PDA

View Full Version : Were there changes to window.getDatabaseNode() in onWindowClosed?



jharp
November 11th, 2025, 21:49
In one of my extensions I have the following:

The call receives a valid window but gives the following error on the window.getDatabaseNode()

[Info : Unity Log] [11/11/2025 11:35:56 AM] [ERROR] Handler error: [string "WindowSaverX2:wsxCore.lua"]:81: attempt to call field 'getDatabaseNode' (a nil value)

Thoughts on any changes to the getDatabaseNode function?

Jason

function onWindowClosed(window)
if running then
local path = window.getDatabaseNode();
if path ~= nil then path = path.getPath() end


wsxUtil.sendEvent({
type="wsx_window_close",
class=window.getClass(),
path=path
});

local containerName = wsxUtil.getContainerName(window.getClass(), path);
local_current_session[containerName] = nil;
end
end

Moon Wizard
November 11th, 2025, 21:55
As of v4.3,
"onWindowClosing" happens as a window has been called to close and contains the parameter for the windowinstance object;
"onWindowClosed" happens after a window has been completely closed, and only returns the window class name of the window closed (since the windowinstance no longer exists).

Regards,
JPG