setMacMainMenu bug?

I’ve implemented a MenuBarModel into my application using the IntroJucer code as an example. All works fine until I open and close a FileChooser window which causes the extra menu items added to the Apple menu to disappear, though the rest of my menu bar is still intact.

I’ve tested this within the IntroJucer code by adding/modifying the following code to the end of JucerApplication::initialise(), but the problem persists here too:

        PopupMenu macMenu;
        macMenu.addItem(1001, "example 1");
        macMenu.addItem(1002, "example 2");
        MenuBarModel::setMacMainMenu (menuModel, &macMenu);

Is this a bug? Or do I need to handle the the MenuBarModel object differently?

Thanks for letting me know - try it again now!

Thanks Jules, all fixed!