From 9802970e8be1fe9511ad9a9d0eb9ffe8d2cfea41 Mon Sep 17 00:00:00 2001 From: Steve Brokenshire Date: Sun, 15 Jan 2017 19:46:46 +0000 Subject: [PATCH] frmSearch: Event posting shouldn't happen when in search mode. --- source/search/frmSearch.cpp | 24 ++++++++++++++---------- 1 file changed, 14 insertions(+), 10 deletions(-) diff --git a/source/search/frmSearch.cpp b/source/search/frmSearch.cpp index d224764..9e4d8aa 100644 --- a/source/search/frmSearch.cpp +++ b/source/search/frmSearch.cpp @@ -463,20 +463,24 @@ void frmSearch::CloseWindow( wxCloseEvent& event ){ // Close window. - WindowData *WData = new WindowData; + if (SearchMode == false){ + + WindowData *WData = new WindowData; - WData->DataType = 2; - WData->WindowPointer = this; - WData->WindowID = SearchUID; + WData->DataType = 2; + WData->WindowPointer = this; + WData->WindowID = SearchUID; - wxCommandEvent delevent(WINDOW_CLOSE); - delevent.SetClientData(WData); - wxPostEvent(GetParent(), delevent); + wxCommandEvent delevent(WINDOW_CLOSE); + delevent.SetClientData(WData); + wxPostEvent(GetParent(), delevent); - wxCommandEvent rs(CE_REMOVESEARCH); - wxPostEvent(this, rs); + wxCommandEvent rs(CE_REMOVESEARCH); + wxPostEvent(this, rs); - WData = NULL; + WData = NULL; + + } this->Destroy(); -- 2.39.5