1
0
Fork 0
mirror of https://github.com/juce-framework/JUCE.git synced 2026-01-20 01:14:20 +00:00
JUCE/modules/juce_events/native
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
..
juce_android_Messaging.cpp Updated all license headers 2020-04-23 17:30:39 +01:00
juce_ios_MessageManager.mm Updated all license headers 2020-04-23 17:30:39 +01:00
juce_linux_EventLoop.h Normalised all whitespace before args in std::function 2020-06-05 09:37:49 +01:00
juce_linux_Messaging.cpp Normalised all whitespace before args in std::function 2020-06-05 09:37:49 +01:00
juce_mac_MessageManager.mm AppDelegate: Ensure correct lifetime of static objects 2021-03-05 11:26:22 +00:00
juce_osx_MessageQueue.h Use RAII for CFTypes 2021-03-25 15:48:35 +00:00
juce_win32_HiddenMessageWindow.h MinGW: Fix windows/gcc warnings 2020-05-11 11:28:28 +01:00
juce_win32_Messaging.cpp FileChooser: Pump message thread in destructor 2021-04-07 16:24:38 +01:00
juce_win32_WinRTWrapper.cpp Windows: Removed WinRT::ComSmartPtr and use existing class instead 2021-01-28 11:26:13 +00:00
juce_win32_WinRTWrapper.h Windows: Removed WinRT::ComSmartPtr and use existing class instead 2021-01-28 11:26:13 +00:00