When FXMenuCommand created with accelerator:
menubar = new FXMenuBar(this, LAYOUT_SIDE_TOP|LAYOUT_FILL_X|FRAME_RIDGE);
fileMenu = new FXMenuPane(this);
new FXMenuCommand(fileMenu,"&Quit\tCtl-Q\tQuit the application.",NULL,app,FXApp::ID_QUIT);
viewMenu = new FXMenuPane(this);
new FXMenuCommand(viewMenu, "Settings...\tCtl-S\tOpen Settings DialogBox", NULL, this, ID_SETTINGS);
new FXMenuTitle(menubar,"&File",NULL,fileMenu);
new FXMenuTitle(menubar,"&View",NULL,viewMenu);
After exit from application there's a SIGSEGV at the following call:
Program received signal SIGSEGV, Segmentation fault.
0x00431ce5 in FX::FXAccelTable::removeAccel(unsigned) (this=0xfeeefeee,
hotkey=262257) at FXAccelTable.cpp:145
145 register FXuint p=(hotkey*13)&max;
Here's the Stack trace from gdb:
---------------------------------
(gdb) bt
#0 0x00431ce5 in FX::FXAccelTable::removeAccel(unsigned) (this=0xfeeefeee,
hotkey=262257) at FXAccelTable.cpp:145
#1 0x0042fd33 in FX::FXMenuCommand::~FXMenuCommand() (this=0xcf76b8)
at FXMenuCommand.cpp:367
#2 0x004122a9 in FX::FXComposite::~FXComposite() (this=0xcf75c0)
at ../include/FXWindow.h:331
#3 0x00412e0a in FX::FXShell::~FXShell() (this=0xcf75c0)
at ../include/FXId.h:53
#4 0x00448a9b in FX::FXPopup::~FXPopup() (this=0xcf75c0) at FXPopup.cpp:877
#5 0x00473e68 in FX::FXMenuPane::~FXMenuPane() (this=0xcf75c0)
at FXMenuPane.cpp:80
#6 0x004122a9 in FX::FXComposite::~FXComposite() (this=0x3ffda8)
at ../include/FXWindow.h:331
#7 0x004419ff in FX::FXRootWindow::~FXRootWindow() (this=0x3ffda8)
at FXRootWindow.cpp:210
#8 0x0041f638 in FX::FXApp::~FXApp() (this=0x22fc70) at FXApp.cpp:4983
#9 0x00406336 in main (argc=1, argv=0x3f2680) at fox.cpp:1383
Logged In: NO
Sorry Guys!!!.
I forgot to delete menu panes in my window destructor.
(BTW. Apart from wiki there's no mention in documentation about destroing menus...).
A.