Skip to content

Commit bb323cc

Browse files
committed
Workspace/WM/application.c(wApplicationDestroy): add more checks if application already has been destroyed.
1 parent 328ac60 commit bb323cc

1 file changed

Lines changed: 4 additions & 5 deletions

File tree

Applications/Workspace/WM/application.c

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -496,16 +496,15 @@ void wApplicationDestroy(WApplication *wapp)
496496
WWindow *wwin;
497497
WScreen *scr;
498498

499-
if (!wapp)
499+
if (!wapp || wapp->refcount != 1) {
500500
return;
501+
}
502+
503+
wapp->refcount--;
501504

502505
WMLogInfo("DESTROY main window:%lu name:%s windows #:%li refcount:%i", wapp->main_window,
503506
wapp->app_icon->wm_instance, CFArrayGetCount(wapp->windows), wapp->refcount);
504507

505-
wapp->refcount--;
506-
if (wapp->refcount > 0)
507-
return;
508-
509508
scr = wapp->main_wwin->screen;
510509

511510
CFNotificationCenterRemoveEveryObserver(scr->notificationCenter, wapp);

0 commit comments

Comments
 (0)