Skip to content

Commit 3a9372c

Browse files
committed
fix crash server status frame
1 parent a12676d commit 3a9372c

File tree

2 files changed

+22
-19
lines changed

2 files changed

+22
-19
lines changed

Release_(3.0)/pgAdmin3.exe

0 Bytes
Binary file not shown.

frm/frmStatus.cpp

+22-19
Original file line numberDiff line numberDiff line change
@@ -2310,25 +2310,28 @@ void frmStatus::OnRefresh(wxCommandEvent &event)
23102310

23112311
void frmStatus::checkConnection()
23122312
{
2313-
if (!locks_connection->IsAlive())
2314-
{
2315-
locks_connection = connection;
2316-
}
2317-
if (!connection->IsAlive())
2318-
{
2319-
delete connection;
2320-
connection = 0;
2321-
statusTimer->Stop();
2322-
locksTimer->Stop();
2323-
if (xactTimer)
2324-
xactTimer->Stop();
2325-
if (logTimer)
2326-
logTimer->Stop();
2327-
if (querystateTimer)
2328-
querystateTimer->Stop();
2329-
actionMenu->Enable(MNU_REFRESH, false);
2330-
toolBar->EnableTool(MNU_REFRESH, false);
2331-
statusBar->SetStatusText(_("Connection broken."));
2313+
if (connection) {
2314+
if (!locks_connection->IsAlive())
2315+
{
2316+
locks_connection = connection;
2317+
}
2318+
if (!connection->IsAlive())
2319+
{
2320+
if (locks_connection==connection) locks_connection = 0;
2321+
delete connection;
2322+
connection = 0;
2323+
statusTimer->Stop();
2324+
locksTimer->Stop();
2325+
if (xactTimer)
2326+
xactTimer->Stop();
2327+
if (logTimer)
2328+
logTimer->Stop();
2329+
if (querystateTimer)
2330+
querystateTimer->Stop();
2331+
actionMenu->Enable(MNU_REFRESH, false);
2332+
toolBar->EnableTool(MNU_REFRESH, false);
2333+
statusBar->SetStatusText(_("Connection broken."));
2334+
}
23322335
}
23332336
}
23342337

0 commit comments

Comments
 (0)