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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user