DocumentWindow setVisisble crash



I have simple application on Mac that have one window derived from the DocumentWindow
and then setVisible is called. However application receives EXC_BAD_ACCESS in that moment

From the juce debug it is crashing in NSViewComponentPeer::toFront on [window makeKeyAndOrderFront: nil]

Any ideas?


It would be very helpful, if you could post the code in which you are calling setvisible.


well it is quite hard to post all as there are lots of files,
However in general
I have LoginWindow derived from DocumentWindow. And I place LoginView (from Component) on it.
Then I simply call setVisisble.
I made a few experiments and during debug it really shows the window, but at any action, like mouseover it crash
( in the TopLevelWindowManager::timerCallback())
seems that it crash at TopLevelWindow* tlw = dynamic_cast <TopLevelWindow*> ©;

Maybe there is a new to create some top window, or
are there any additional inintialization to be done ?
like initialiseJuce_GUI…, etc.


Can you post the code where you calling setVisible. Secondly you are much better off calling setContentComponent instead of setVisible in the class derived from DocumentWindow.

Are you using juce as library?