Alright, I am currently, creating a plugin that adds a new menu to the menu bar, I've just encountered a couple of problems, one solved on my own, one i could need some assistance with.
First off, i had a problem with Code::blocks crashing every time i tried to update or uninstall my plugin, and when i for once shutdown Code::Blocks properly without crashing, the process kept hanging the the task manager. Got it analyzed down to being the MenuBar's Insert/Append/Perpend functions that triggered it on release/destructor/stuff. After searching around, i got the crash fixed so;
From
class UML__Blocks : public cbPlugin
{
public:
*Inherited methods and such*
wxMenu UMLMenu; //New Menu
protected:
*More Inherited methods and such*
};
UML__Blocks::UML__Blocks() : new UMLMenu(wxT("UML Menu"))
{
*derp*
}
void UML__Blocks::BuildMenu(wxMenuBar* MenuBar)
{
MenuBar->Insert(3, &UMLMenu, wxT("UML"));
}
To
class UML__Blocks : public cbPlugin
{
public:
*Inherited methods and such*
wxMenu* UMLMenu; //New Menu
protected:
*More Inherited methods and such*
};
void UML__Blocks::BuildMenu(wxMenuBar* MenuBar)
{
UMLMenu = new wxMenu(wxT("UML"));
MenuBar->Insert(3, UMLMenu, wxT("UML"));
}
That apparently threw the whole menu on the heap with help from a pointer. It fixed the crashing issue, but the other problem still persists.
The Process still hangs, on a normal shutdown, and i have pretty much no clue why, other than all the trouble began when i wanted to add the menu.
Can anyone please help, or at least guide me in the right direction? I'm sorry if it's because of a certain lack of c++ skills or if the answer was right in front of me the entire time,
-Lex