Hello.
I would like you to check this patch.
Frequently there are opened several windows: edit grids and queries. In this case, if you try to change macro or favourites list, pgadmin exits with error immediately. Though, this isn't happening while all edit grids are closed. I propose a solution - to check the presence of the macros menu (or favourites, if you change the favourites list) and the visibility of the query window (to prevent false event when the window is just starts to be opened).
Patch is attached to the letter.
Thank you.

--
Dmitriy Olshevskiy

From 0a8abe52f306e354f1a37c8919954db347d37b51 Mon Sep 17 00:00:00 2001
From: olshevskiy87 <[email protected]>
Date: Thu, 7 Aug 2014 23:48:19 +0400
Subject: [PATCH]  prevent a crash during the macro or favourite list updating

---
 pgadmin/frm/frmQuery.cpp | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/pgadmin/frm/frmQuery.cpp b/pgadmin/frm/frmQuery.cpp
index 1f5fd43..0608489 100644
--- a/pgadmin/frm/frmQuery.cpp
+++ b/pgadmin/frm/frmQuery.cpp
@@ -1499,6 +1499,9 @@ void frmQuery::updateMenu(bool allowUpdateModelSize)
 
 void frmQuery::UpdateFavouritesList()
 {
+       if (IsVisible() && menuBar->FindMenu(_("Fav&ourites")) == wxNOT_FOUND)
+               return;
+       
        if (favourites)
                delete favourites;
 
@@ -1515,6 +1518,9 @@ void frmQuery::UpdateFavouritesList()
 
 void frmQuery::UpdateMacrosList()
 {
+       if (IsVisible() && menuBar->FindMenu(_("&Macros")) == wxNOT_FOUND)
+               return;
+
        if (macros)
                delete macros;
 
-- 
1.8.3.msysgit.0

-- 
Sent via pgadmin-hackers mailing list ([email protected])
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgadmin-hackers

Reply via email to