summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJaakko Keranen <jaakko.keranen@iki.fi>2020-11-02 19:53:10 +0200
committerJaakko Keranen <jaakko.keranen@iki.fi>2020-11-02 19:53:10 +0200
commitcb83f2a1cfa897df22e7ab119fe531276f9459a6 (patch)
tree770ceffe5a330f22e51cf994a56b367550a69397 /src
parent15f459bdbeec2357d4a2c8f822ad287814e1577f (diff)
Fixed potential crash at app shutdown
Delete garbage collected widgets in Window deinitialization. Widgets should not continue to exist if there is no Window.
Diffstat (limited to 'src')
-rw-r--r--src/app.c1
-rw-r--r--src/main.c1
-rw-r--r--src/ui/window.c1
3 files changed, 2 insertions, 1 deletions
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) {
444 deinit_CommandLine(&d->args); 444 deinit_CommandLine(&d->args);
445 iRelease(d->launchCommands); 445 iRelease(d->launchCommands);
446 delete_String(d->execPath); 446 delete_String(d->execPath);
447 iRecycle();
447} 448}
448 449
449const iString *execPath_App(void) { 450const 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) {
59 return -1; 59 return -1;
60 } 60 }
61 run_App(argc, argv); 61 run_App(argc, argv);
62 iRecycle();
63 SDL_Quit(); 62 SDL_Quit();
64#if defined (LAGRANGE_ENABLE_MPG123) 63#if defined (LAGRANGE_ENABLE_MPG123)
65 mpg123_exit(); 64 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) {
605} 605}
606 606
607void deinit_Window(iWindow *d) { 607void deinit_Window(iWindow *d) {
608 iRecycle();
608 if (theWindow_ == d) { 609 if (theWindow_ == d) {
609 theWindow_ = NULL; 610 theWindow_ = NULL;
610 } 611 }