Re: pgadmin3-1.6.1 - core dumped - Work around

Поиск
Список
Период
Сортировка
От Dhanaraj M
Тема Re: pgadmin3-1.6.1 - core dumped - Work around
Дата
Msg-id 45828A25.60105@sun.com
обсуждение исходный текст
Ответ на Re: pgadmin3-1.6.1 - core dumped - Work around  (Dave Page <dpage@postgresql.org>)
Ответы Re: pgadmin3-1.6.1 - core dumped - Work around  (Zdenek Kotala <Zdenek.Kotala@Sun.COM>)
Список 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@postgresql.org so that your
>       message can get through to the mailing list cleanly
>
>


В списке pgadmin-hackers по дате отправления:

Предыдущее
От: Dave Page
Дата:
Сообщение: Re: pgadmin3-1.6.1 - core dumped - Work around
Следующее
От: Zdenek Kotala
Дата:
Сообщение: Re: pgadmin3-1.6.1 - core dumped - Work around