From 0cafb0786ef8e0c33d2ea34e97c1b89ffc3fb70a Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Fri, 1 Jun 2012 11:01:05 +0000 Subject: [PATCH] Don't reset previous window event handler in PopEventHandler(). This is harmless but also useless as the previous event handler of a wxWindow is always NULL anyhow, so simply don't do this. This is consistent with PushEventHandler() which doesn't call SetPreviousHandler() for the window itself neither. Closes #14353. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@71621 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/common/wincmn.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/common/wincmn.cpp b/src/common/wincmn.cpp index ce2bb0a237..a2b359156c 100644 --- a/src/common/wincmn.cpp +++ b/src/common/wincmn.cpp @@ -1439,7 +1439,11 @@ wxEvtHandler *wxWindowBase::PopEventHandler(bool deleteHandler) "the first handler of the wxWindow stack should have non-NULL next handler" ); firstHandler->SetNextHandler(NULL); - secondHandler->SetPreviousHandler(NULL); + + // It is harmless but useless to unset the previous handler of the window + // itself as it's always NULL anyhow, so don't do this. + if ( secondHandler != this ) + secondHandler->SetPreviousHandler(NULL); // now firstHandler is completely unlinked; set secondHandler as the new window event handler SetEventHandler(secondHandler); -- 2.45.2