Re: pgadmin3-1.6.1 - core dumped - Work around

From: Dhanaraj M <Dhanaraj(dot)M(at)Sun(dot)COM>
To: Dave Page <dpage(at)postgresql(dot)org>
Cc: Zdenek Kotala <Zdenek(dot)Kotala(at)Sun(dot)COM>, pgadmin-hackers(at)postgresql(dot)org
Subject: Re: pgadmin3-1.6.1 - core dumped - Work around
Date: 2006-12-15 11:42:29
Message-ID: 45828A25.60105@sun.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgadmin-hackers


Hi Zdenek,

I tested this and still both problems exist (Add server and query tool
-core dump)
Can you test it once?

Dave Page wrote:

> Zdenek Kotala wrote:
>
>>> I'm still not sure how you're getting into that code when you close
>>> the form though...
>>
>>
>> The root cause is destructor of frmQuery dialog. It removes all
>> connection from combo box exclude last item - "new connection". Each
>> deletion invoke frmQuery::OnChangeConnection event and the
>> OnChangeConnection method invokes "new connection dialog" in the last
>> step. And because there are some empty combo boxes on this dialog,
>> gtk generates core.
>
>
> Ah, of course - well spotted.
>
>> My suggestion is disable event generation for cbConnection in the
>> destructor.
>
>
> Agreed. Can one or both of you test the attached patch please?
>
> Thanks, Dave.
>
>------------------------------------------------------------------------
>
>Index: frmQuery.cpp
>===================================================================
>--- frmQuery.cpp (revision 5791)
>+++ frmQuery.cpp (working copy)
>@@ -62,7 +62,6 @@
> BEGIN_EVENT_TABLE(frmQuery, pgFrame)
> EVT_ERASE_BACKGROUND( frmQuery::OnEraseBackground)
> EVT_SIZE( frmQuery::OnSize)
>- EVT_COMBOBOX(CTRLID_CONNECTION, frmQuery::OnChangeConnection)
> EVT_CLOSE( frmQuery::OnClose)
> EVT_SET_FOCUS( frmQuery::OnSetFocus)
> EVT_MENU(MNU_NEW, frmQuery::OnNew)
>@@ -280,6 +279,7 @@
> outputPane->AddPage(msgResult, _("Messages"));
> outputPane->AddPage(msgHistory, _("History"));
>
>+ this->Connect(CTRLID_CONNECTION, wxEVT_COMMAND_COMBOBOX_SELECTED, wxCommandEventHandler(frmQuery::OnChangeConnection));
> sqlQuery->Connect(wxID_ANY, wxEVT_SET_FOCUS,wxFocusEventHandler(frmQuery::OnFocus));
> sqlResult->Connect(wxID_ANY, wxEVT_SET_FOCUS, wxFocusEventHandler(frmQuery::OnFocus));
> msgResult->Connect(wxID_ANY, wxEVT_SET_FOCUS, wxFocusEventHandler(frmQuery::OnFocus));
>@@ -369,6 +369,7 @@
> sqlResult->Disconnect(wxID_ANY, wxEVT_SET_FOCUS, wxFocusEventHandler(frmQuery::OnFocus));
> msgResult->Disconnect(wxID_ANY, wxEVT_SET_FOCUS, wxFocusEventHandler(frmQuery::OnFocus));
> msgHistory->Disconnect(wxID_ANY, wxEVT_SET_FOCUS, wxFocusEventHandler(frmQuery::OnFocus));
>+ this->Disconnect(CTRLID_CONNECTION, wxEVT_COMMAND_COMBOBOX_SELECTED, wxCommandEventHandler(frmQuery::OnChangeConnection));
>
> if (mainForm)
> mainForm->RemoveFrame(this);
>@@ -632,10 +633,6 @@
>
> void frmQuery::OnChangeConnection(wxCommandEvent &ev)
> {
>- // On Solaris, this event seems to get fired when the form closes(!!)
>- if(!IsVisible())
>- return;
>-
> unsigned int sel=cbConnection->GetCurrentSelection();
> if (sel == cbConnection->GetCount()-1)
> {
>
>
>------------------------------------------------------------------------
>
>
>---------------------------(end of broadcast)---------------------------
>TIP 1: if posting/reading through Usenet, please send an appropriate
> subscribe-nomail command to majordomo(at)postgresql(dot)org so that your
> message can get through to the mailing list cleanly
>
>

In response to

Responses

Browse pgadmin-hackers by date

  From Date Subject
Next Message Zdenek Kotala 2006-12-15 12:44:00 Re: pgadmin3-1.6.1 - core dumped - Work around
Previous Message Dave Page 2006-12-15 10:13:30 Re: pgadmin3-1.6.1 - core dumped - Work around