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:
@@ -117,20 +117,20 @@ void cLuaWindow::SetOnSlotChanged(cPlugin_NewLua * a_Plugin, int a_FnRef)
|
||||
|
||||
|
||||
|
||||
bool cLuaWindow::ClosedByPlayer(cPlayer & a_Player)
|
||||
bool cLuaWindow::ClosedByPlayer(cPlayer & a_Player, bool a_CanRefuse)
|
||||
{
|
||||
// First notify the plugin through the registered callback:
|
||||
if (m_OnClosingFnRef != LUA_REFNIL)
|
||||
{
|
||||
ASSERT(m_Plugin != NULL);
|
||||
if (m_Plugin->CallbackWindowClosing(m_OnClosingFnRef, *this, a_Player))
|
||||
if (m_Plugin->CallbackWindowClosing(m_OnClosingFnRef, *this, a_Player, a_CanRefuse))
|
||||
{
|
||||
// The callback disagrees
|
||||
// The callback disagrees (the higher levels check the CanRefuse flag compliance)
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
return super::ClosedByPlayer(a_Player);
|
||||
return super::ClosedByPlayer(a_Player, a_CanRefuse);
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user