1
0

LuaWindow: Fixed memory leaks with unclosed windows

A player disconnecting will now force all windows to close, not respecting any plugin's overrides.
http://forum.mc-server.org/showthread.php?tid=1146&pid=8350#pid8350

git-svn-id: http://mc-server.googlecode.com/svn/trunk@1543 0a769ca7-a7f5-676a-18bf-c427514a06d6
This commit is contained in:
madmaxoft@gmail.com
2013-06-02 21:59:25 +00:00
parent d2b3011c05
commit 8ff22344af
9 changed files with 22 additions and 21 deletions

View File

@@ -582,10 +582,10 @@ function HandleTestWndCmd(a_Split, a_Player)
-- Test out the OnClosing callback's ability to refuse to close the window
local attempt = 1;
local OnClosing = function(Window, Player)
Player:SendMessage("Window closing attempt #" .. attempt);
local OnClosing = function(Window, Player, CanRefuse)
Player:SendMessage("Window closing attempt #" .. attempt .. "; CanRefuse = " .. tostring(CanRefuse));
attempt = attempt + 1;
return (attempt <= 3); -- refuse twice, then allow
return CanRefuse and (attempt <= 3); -- refuse twice, then allow, unless CanRefuse is set to true
end
-- Log the slot changes