Make a weak pointer for GApplication startup lambda

Or it never gets destroyed
This commit is contained in:
Ilya Fedin 2023-07-21 04:00:59 +04:00 committed by John Preston
parent 5fc10c934a
commit 3cb49127f4
1 changed files with 6 additions and 1 deletions

View File

@ -222,7 +222,12 @@ void LinuxIntegration::LaunchNativeApplication() {
G_APPLICATION_HANDLES_OPEN,
nullptr)));
app->signal_startup().connect([=] {
app->signal_startup().connect([weak = std::weak_ptr(app)] {
const auto app = weak.lock();
if (!app) {
return;
}
// GNotification
InvokeQueued(qApp, [] {
Core::App().notifications().createManager();