diff options
author | Vladimir Belyavsky <belyavskyv@gmail.com> | 2022-05-14 17:23:17 +0300 |
---|---|---|
committer | Vladimir Belyavsky <belyavskyv@gmail.com> | 2022-06-03 09:34:19 +0300 |
commit | 66bcb66a51b523fdb6dabefa6366abed17f3b06f (patch) | |
tree | 703cdbac71088c77afb9197ba20da19b6ca96cdd /src/plugins/platforms/windows/qwindowsdialoghelpers.h | |
parent | 4a8611a902cc85ca6f93394f9e18d343f41e4112 (diff) |
Windows: fix crash on closing an app when native file dialog is opened
The crash was provoked by QThread::terminate() called
for QWindowsDialogThread from QWindowsDialogHelperBase destructor.
It's still not clear why terminating the thread here causes a crash,
but normally we should avoid terminating a thread anyway.
Current changes make several improvements to avoid terminating the
thread. The main problem was that QWindowsDialogThread::run() was never
returned. That's because QWindowsNativeFileDialogBase::close() was not
called on QWindowsDialogHelperBase destruction. The second problem
was that QWindowsNativeFileDialogBase::close() may still not close
native file dialog because it was not able to find HWND for IFileDialog
instance in some circumstances, so make this by more robust way.
Fixes: QTBUG-93298
Pick-to: 6.3
Change-Id: I55c8cf664ae2cf7c41c8cce43a6bb88a2680bf14
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
Diffstat (limited to 'src/plugins/platforms/windows/qwindowsdialoghelpers.h')
-rw-r--r-- | src/plugins/platforms/windows/qwindowsdialoghelpers.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/plugins/platforms/windows/qwindowsdialoghelpers.h b/src/plugins/platforms/windows/qwindowsdialoghelpers.h index de272289c0..64f40bc3a9 100644 --- a/src/plugins/platforms/windows/qwindowsdialoghelpers.h +++ b/src/plugins/platforms/windows/qwindowsdialoghelpers.h @@ -31,7 +31,7 @@ class QWindowsDialogHelperBase : public BaseClass Q_DISABLE_COPY_MOVE(QWindowsDialogHelperBase) public: using QWindowsNativeDialogBasePtr = QSharedPointer<QWindowsNativeDialogBase>; - ~QWindowsDialogHelperBase() { cleanupThread(); } + ~QWindowsDialogHelperBase(); void exec() override; bool show(Qt::WindowFlags windowFlags, |