1
0
Fork 0
mirror of https://github.com/juce-framework/JUCE.git synced 2026-01-10 23:44:24 +00:00
JUCE/modules/juce_events
reuk b952d0204e
FileChooser: Pump message thread in destructor
IFileDialog::Show and CoUninitialize both seem to require the main
message loop to be active and running when they are called. If we block
the message thread while calling these functions, we may cause a
deadlock.

The destructor of the Win32NativeFileChooser was blocking the message
thread until the background thread exited, but the background thread was
unable to make progress while the message thread was blocked.

To work around this issue, we now pump the message thread in the
destructor of the Win32NativeFileChooser. If a dialog is currently
active, this should allow it to exit gracefully.

Note that we cannot use MessageManager::runDispatchLoopUntil here:
- MessageManager::runDispatchLoopUntil will not process any messages if
  the quit message has been received, which could lead to deadlocks if the
  FileChooser is destroyed after the quit message has been posted.
- This function isn't defined when JUCE_MODAL_LOOPS_PERMITTED is disabled.
2021-04-07 16:24:38 +01:00
..
broadcasters Updated all license headers 2020-04-23 17:30:39 +01:00
interprocess IPC: Prevent disconnection while a read is in progress 2020-11-16 20:13:46 +00:00
messages Added preliminary support for FreeBSD 2021-03-29 14:16:46 +01:00
native FileChooser: Pump message thread in destructor 2021-04-07 16:24:38 +01:00
timers Made the assertion in the Timer destructor slightly less strict 2020-11-13 18:16:04 +00:00
juce_events.cpp Added preliminary support for FreeBSD 2021-03-29 14:16:46 +01:00
juce_events.h Added preliminary support for FreeBSD 2021-03-29 14:16:46 +01:00
juce_events.mm Updated all license headers 2020-04-23 17:30:39 +01:00