mirror of
https://github.com/juce-framework/JUCE.git
synced 2026-01-10 23:44:24 +00:00
Fixed a crash on quit when windows are open in the Juce Demo's windows demo
This commit is contained in:
parent
e435325619
commit
26e0aa735c
1 changed files with 14 additions and 2 deletions
|
|
@ -212,6 +212,15 @@ public:
|
|||
|
||||
~WindowsDemo()
|
||||
{
|
||||
if (dialogWindow != nullptr)
|
||||
{
|
||||
dialogWindow->exitModalState (0);
|
||||
|
||||
// we are shutting down: can't wait for the message manager
|
||||
// to eventually delete this
|
||||
delete dialogWindow;
|
||||
}
|
||||
|
||||
closeAllWindows();
|
||||
|
||||
closeWindowsButton.removeListener (this);
|
||||
|
|
@ -239,6 +248,7 @@ private:
|
|||
// null when the component that it points to is deleted.
|
||||
Array< Component::SafePointer<Component> > windows;
|
||||
TextButton showWindowsButton, closeWindowsButton;
|
||||
SafePointer<DialogWindow> dialogWindow;
|
||||
|
||||
void showAllWindows()
|
||||
{
|
||||
|
|
@ -282,8 +292,10 @@ private:
|
|||
options.useNativeTitleBar = false;
|
||||
options.resizable = true;
|
||||
|
||||
DialogWindow* dw = options.launchAsync();
|
||||
dw->centreWithSize (300, 200);
|
||||
dialogWindow = options.launchAsync();
|
||||
|
||||
if (dialogWindow != nullptr)
|
||||
dialogWindow->centreWithSize (300, 200);
|
||||
}
|
||||
|
||||
void showDocumentWindow (bool native)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue