From 5ecc553afb50b2ee503a3eba76f8a9d87f48c576 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Sun, 19 Apr 2020 17:07:04 +0200 Subject: [PATCH] Add wxToastNotifMsgModule dependency on wxOleInitModule This ensures that OLE is still initialized when this module cleanup occurs, as it must be when IToastNotificationManagerStatics COM pointer is destroyed. Closes #18730. --- src/msw/rt/notifmsgrt.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/msw/rt/notifmsgrt.cpp b/src/msw/rt/notifmsgrt.cpp index 3b9ba571ce..d91e64454b 100644 --- a/src/msw/rt/notifmsgrt.cpp +++ b/src/msw/rt/notifmsgrt.cpp @@ -463,6 +463,9 @@ class wxToastNotifMsgModule : public wxModule public: wxToastNotifMsgModule() { + // Using RT API requires OLE and, importantly, we must ensure our + // OnExit() runs before it is uninitialized. + AddDependency("wxOleInitModule"); } virtual bool OnInit() wxOVERRIDE