From a8fbd905c258e57a698187b471f10f81eb516ea0 Mon Sep 17 00:00:00 2001 From: Simon Robertshaw Date: Fri, 10 Aug 2012 22:59:46 +0100 Subject: [PATCH] Fix issue where buttons will cause heap corruption if they are removed from inside DoAction --- src/game/GameView.cpp | 1 - src/interface/Button.cpp | 3 +-- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/src/game/GameView.cpp b/src/game/GameView.cpp index 106e4e076..df755f008 100644 --- a/src/game/GameView.cpp +++ b/src/game/GameView.cpp @@ -1490,7 +1490,6 @@ void GameView::NotifyNotificationsChanged(GameModel * sender) } notificationComponents.clear(); - std::vector notifications = sender->GetNotifications(); int currentY = YRES-23; diff --git a/src/interface/Button.cpp b/src/interface/Button.cpp index a9b0606aa..d5cc3824a 100644 --- a/src/interface/Button.cpp +++ b/src/interface/Button.cpp @@ -151,10 +151,9 @@ void Button::OnMouseUp(int x, int y, unsigned int button) if(isButtonDown) { + isButtonDown = false; DoAction(); } - - isButtonDown = false; } void Button::OnMouseClick(int x, int y, unsigned int button)