Re: Crash during displaying drop-down menu for - Mailing list pgadmin-hackers

From Tomasz Rybak
Subject Re: Crash during displaying drop-down menu for
Date
Msg-id 1128800571.15545.10.camel@localhost.localdomain
Whole thread Raw
In response to Re: Crash during displaying drop-down menu for server  ("Dave Page" <dpage@vale-housing.co.uk>)
Responses Re: Crash during displaying drop-down menu for
List pgadmin-hackers
I think I know what's causing this crash.
However, I don't know where to fix it.
I'll be writing about file src/main/events.cpp.

When I right-click, frmMain::doPopup is called.
It creates new treeContextMenu, and appends all active
options from main menu. Here's how it looks just before crash:
Item 1176
0 1160 O
1 -2
2 1177 P
3 1182 U
4 -2
5 1195 W

(it's from code:
printf("Item %i\n", newMenuFactory->GetId());
size_t i;
wxMenuItemList j = treeContextMenu->GetMenuItems();
for (i=0 ; i < j.GetCount() ; i++)
{
    printf("%i %i %s\n", i, j.Item(i)->GetData()->GetId(),
j.Item(i)->GetData()->GetText().c_str());
}

It looks for menu item 1176 (New object), but this item is inactive.
However after starting pgAdmin it is active, made it so by code:
src/frm/frmMain.cpp, line 172:
newMenuFactory = new dummyActionFactory(menuFactories);     //
placeholder
where "New objects" submenu will be inserted
    editMenu->Append(newMenuFactory->GetId(), _("New &Object"), newMenu,
_("Create a new object."));

It's mede inactive after clicking on server, and remains so until
connecting to server. Then menu looks like that:
Item 1176
0 1160 O
1 -2
2 1176 N
3 1178 R
4 1182 U
5 -2
6 1195 W
And now New Object is active, so it's included in treeContextMenu.

I tried to disable deactivating newMenu by commenting out line 341:
editMenu->Enable(newMenuFactory->GetId(), false);
but it didn't work.

--
Tomasz Rybak <bogomips@post.pl>


pgadmin-hackers by date:

Previous
From: svn@pgadmin.org
Date:
Subject: SVN Commit by andreas: r4522 - in trunk/pgadmin3: . src/dlg src/schema
Next
From: svn@pgadmin.org
Date:
Subject: SVN Commit by andreas: r4523 - in trunk/pgadmin3: . src/include src/include/images src/main src/schema src/slony src/slony/include