mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2025-06-05 06:33:57 +02:00
Make a weak pointer for GApplication startup lambda
Or it never gets destroyed
This commit is contained in:
parent
5fc10c934a
commit
3cb49127f4
1 changed files with 6 additions and 1 deletions
|
@ -222,7 +222,12 @@ void LinuxIntegration::LaunchNativeApplication() {
|
||||||
G_APPLICATION_HANDLES_OPEN,
|
G_APPLICATION_HANDLES_OPEN,
|
||||||
nullptr)));
|
nullptr)));
|
||||||
|
|
||||||
app->signal_startup().connect([=] {
|
app->signal_startup().connect([weak = std::weak_ptr(app)] {
|
||||||
|
const auto app = weak.lock();
|
||||||
|
if (!app) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
// GNotification
|
// GNotification
|
||||||
InvokeQueued(qApp, [] {
|
InvokeQueued(qApp, [] {
|
||||||
Core::App().notifications().createManager();
|
Core::App().notifications().createManager();
|
||||||
|
|
Loading…
Add table
Reference in a new issue