Problem with menu change notification


#1

Hi,

I'm having problems with getting a MenuBarModel to send a change notification to its parent Document Window. When a menu item is selected the following code is executed (MainMenu is defined "public MenuBarModel" )


void MainMenu::menuItemSelected (int menuItemID, int menuIndex)

{   
    switch (menuItemID)
    {                                               
    case MENU_WIZARD:
         menuItemsChanged();
         break;

     case MENU_EXIT:
         JUCEApplication::quit ();
         break;
      }
} 

Once this code is executed the main thread crashes with an invalid address deep in the Carbon message queue handling. It doesn't really matter what I do to the listener - it never actually gets that far.

Any ideas?


#2

Not enough info here - obviously if what you do in this method doesn't affect the crash, then it's not relevant. You'll just have a dangling pointer somewhere, probably the instance of this "MainMenu" class.