From 8ff22344af60a8f1d7de4501f04c7f659bd5bb08 Mon Sep 17 00:00:00 2001 From: "madmaxoft@gmail.com" Date: Sun, 2 Jun 2013 21:59:25 +0000 Subject: 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 --- source/LuaWindow.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'source/LuaWindow.cpp') diff --git a/source/LuaWindow.cpp b/source/LuaWindow.cpp index f6277250c..13d06eeb6 100644 --- a/source/LuaWindow.cpp +++ b/source/LuaWindow.cpp @@ -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); } -- cgit v1.2.3