Log Message:
-----------
fix disconnect check

Modified Files:
--------------
    pgadmin3/src/ui:
        frmMain.cpp (r1.93 -> r1.94)

Index: frmMain.cpp
===================================================================
RCS file: /projects/pgadmin3/src/ui/frmMain.cpp,v
retrieving revision 1.93
retrieving revision 1.94
diff -Lsrc/ui/frmMain.cpp -Lsrc/ui/frmMain.cpp -u -w -r1.93 -r1.94
--- src/ui/frmMain.cpp
+++ src/ui/frmMain.cpp
@@ -549,11 +549,14 @@
                         while (item)
                         {
                             pgDatabase *db=(pgDatabase*)browser->GetItemData(item);
-                            if (db && db->GetType() == PG_DATABASE && 
db->GetConnected() && db->connection())
+                            if (db && db->GetType() == PG_DATABASE)
                             {
-                                if (!db->connection()->IsAlive() && 
db->connection()->GetStatus() == PGCONN_BROKEN)
+                                pgConn *conn=db->GetConnection();
+                                if (conn)
                                 {
-                                    db->connection()->Close();
+                                    if (!conn->IsAlive() && conn->GetStatus() == 
PGCONN_BROKEN)
+                                    {
+                                        conn->Close();
                                     if (!userInformed)
                                     {
                                         wxMessageDialog dlg(this, _("Close database 
browser? If you abort, the object browser will not show accurate data."),
@@ -572,6 +575,7 @@
                                     }
                                 }
                             }
+                            }
                             item = browser->GetNextChild(obj->GetId(), cookie3);
                         }
                     }
---------------------------(end of broadcast)---------------------------
TIP 3: if posting/reading through Usenet, please send an appropriate
      subscribe-nomail command to [EMAIL PROTECTED] so that your
      message can get through to the mailing list cleanly

Reply via email to