Avoid updating the GQB if closing the window.
authordpage <dpage@a7884b65-44f6-0310-8a51-81a127f17b15>
Mon, 23 Mar 2009 11:28:50 +0000 (11:28 +0000)
committerdpage <dpage@a7884b65-44f6-0310-8a51-81a127f17b15>
Mon, 23 Mar 2009 11:28:50 +0000 (11:28 +0000)
git-svn-id: svn://svn.pgadmin.org/trunk/pgadmin3@7741 a7884b65-44f6-0310-8a51-81a127f17b15

pgadmin/frm/frmQuery.cpp

index c0c0d0880b9803911ef00fc1d95cc315f4e00492..b141a5a00415c5bbbfeb63f30f96d96405ccbb2d 100644 (file)
@@ -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;