mirror of
https://github.com/kotatogram/kotatogram-desktop
synced 2025-08-30 14:17:45 +00:00
Fix possible crash in event loop nesting.
This commit is contained in:
@@ -8,6 +8,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
||||
#include "platform/win/windows_event_filter.h"
|
||||
|
||||
#include "platform/win/windows_dlls.h"
|
||||
#include "core/sandbox.h"
|
||||
#include "mainwindow.h"
|
||||
#include "main/main_session.h"
|
||||
|
||||
@@ -55,6 +56,7 @@ bool EventFilter::nativeEventFilter(
|
||||
const QByteArray &eventType,
|
||||
void *message,
|
||||
long *result) {
|
||||
return Core::Sandbox::Instance().customEnterFromEventLoop([&] {
|
||||
const auto msg = static_cast<MSG*>(message);
|
||||
if (msg->message == WM_ENDSESSION) {
|
||||
App::quit();
|
||||
@@ -70,6 +72,7 @@ bool EventFilter::nativeEventFilter(
|
||||
(LRESULT*)result);
|
||||
}
|
||||
return false;
|
||||
});
|
||||
}
|
||||
|
||||
bool EventFilter::mainWindowEvent(
|
||||
|
Reference in New Issue
Block a user