From cb83f2a1cfa897df22e7ab119fe531276f9459a6 Mon Sep 17 00:00:00 2001 From: Jaakko Keranen Date: Mon, 2 Nov 2020 19:53:10 +0200 Subject: Fixed potential crash at app shutdown Delete garbage collected widgets in Window deinitialization. Widgets should not continue to exist if there is no Window. --- src/app.c | 1 + src/main.c | 1 - src/ui/window.c | 1 + 3 files changed, 2 insertions(+), 1 deletion(-) diff --git a/src/app.c b/src/app.c index c2d5b732..8c14c6e6 100644 --- a/src/app.c +++ b/src/app.c @@ -444,6 +444,7 @@ static void deinit_App(iApp *d) { deinit_CommandLine(&d->args); iRelease(d->launchCommands); delete_String(d->execPath); + iRecycle(); } const iString *execPath_App(void) { diff --git a/src/main.c b/src/main.c index 2f9eda0e..e2c2cc83 100644 --- a/src/main.c +++ b/src/main.c @@ -59,7 +59,6 @@ int main(int argc, char **argv) { return -1; } run_App(argc, argv); - iRecycle(); SDL_Quit(); #if defined (LAGRANGE_ENABLE_MPG123) mpg123_exit(); diff --git a/src/ui/window.c b/src/ui/window.c index 21338fa8..8aa701e3 100644 --- a/src/ui/window.c +++ b/src/ui/window.c @@ -605,6 +605,7 @@ void init_Window(iWindow *d, iRect rect) { } void deinit_Window(iWindow *d) { + iRecycle(); if (theWindow_ == d) { theWindow_ = NULL; } -- cgit v1.2.3