From: dpage Date: Mon, 23 Mar 2009 11:28:50 +0000 (+0000) Subject: Avoid updating the GQB if closing the window. X-Git-Url: http://git.postgresql.org/gitweb/static/gitweb.js?a=commitdiff_plain;h=6b49a8bf6984b9382ed470fd9ce3ba74c38cce74;p=users%2Fquan74%2Fpgadmin-import.git Avoid updating the GQB if closing the window. git-svn-id: svn://svn.pgadmin.org/trunk/pgadmin3@7741 a7884b65-44f6-0310-8a51-81a127f17b15 --- diff --git a/pgadmin/frm/frmQuery.cpp b/pgadmin/frm/frmQuery.cpp index c0c0d0880..b141a5a00 100644 --- a/pgadmin/frm/frmQuery.cpp +++ b/pgadmin/frm/frmQuery.cpp @@ -490,6 +490,8 @@ pgsTimer(new pgScriptTimer(this)) frmQuery::~frmQuery() { + closing = true; + sqlQuery->Disconnect(wxID_ANY, wxEVT_SET_FOCUS,wxFocusEventHandler(frmQuery::OnFocus)); sqlResult->Disconnect(wxID_ANY, wxEVT_SET_FOCUS, wxFocusEventHandler(frmQuery::OnFocus)); msgResult->Disconnect(wxID_ANY, wxEVT_SET_FOCUS, wxFocusEventHandler(frmQuery::OnFocus)); @@ -1757,6 +1759,9 @@ void frmQuery::OnExplain(wxCommandEvent& event) // Update the main SQL query from the GQB if desired bool frmQuery::updateFromGqb(bool executing) { + if (closing) + return false; + // Make sure this doesn't get call recursively through an event if (gqbUpdateRunning) return false;