=> 4c7783f32e779572ef6c421463b5ca04fd09a477
[1mdiff --git a/src/app.c b/src/app.c[m [1mindex b4ce8a81..21b1f803 100644[m [1m--- a/src/app.c[m [1m+++ b/src/app.c[m [36m@@ -1498,6 +1498,9 @@[m [mstatic void init_App_(iApp *d, int argc, char **argv) {[m }[m [m static void deinit_App(iApp *d) {[m [32m+[m[32m if (d->tempFilesPendingDeletion == NULL) {[m [32m+[m[32m return; /* already deinitialized */[m [32m+[m[32m }[m #if defined (iPlatformAppleDesktop) && defined (LAGRANGE_NATIVE_MENU)[m delete_Root(d->submenuRoot);[m #endif[m [36m@@ -1560,6 +1563,7 @@[m [mstatic void deinit_App(iApp *d) {[m iRelease(d->recentlySubmittedInput);[m iRelease(d->recentlyClosedTabUrls);[m iRelease(d->tempFilesPendingDeletion);[m [32m+[m[32m d->tempFilesPendingDeletion = NULL;[m }[m [m const iString *execPath_App(void) {[m [36m@@ -1961,6 +1965,21 @@[m [mvoid processEvents_App(enum iAppEventMode eventMode) {[m processEvents_App(postedEventsOnly_AppEventMode);[m }[m goto backToMainLoop;[m [32m+[m[32m case SDL_APP_TERMINATING: {[m [32m+[m[32m iForEach(PtrArray, i, &d->mainWindows) {[m [32m+[m[32m setFreezeDraw_MainWindow(*i.value, iTrue);[m [32m+[m[32m }[m [32m+[m[32m#if defined (iPlatformAppleMobile)[m [32m+[m[32m /* SDL docs warn that we may not get any execution time after this event,[m [32m+[m[32m so deinitialize everything immediately. */[m [32m+[m[32m deinit_App(d);[m [32m+[m[32m goto backToMainLoop; /* no further processing of events */[m [32m+[m[32m#else[m [32m+[m[32m savePrefs_App_(d);[m [32m+[m[32m saveState_App_(d, iTrue);[m [32m+[m[32m#endif[m [32m+[m[32m break;[m [32m+[m[32m }[m case SDL_APP_LOWMEMORY:[m clearCache_App_();[m break;[m [36m@@ -2000,14 +2019,6 @@[m [mvoid processEvents_App(enum iAppEventMode eventMode) {[m }[m break;[m }[m [31m- case SDL_APP_TERMINATING: {[m [31m- iForEach(PtrArray, i, &d->mainWindows) {[m [31m- setFreezeDraw_MainWindow(*i.value, iTrue);[m [31m- }[m [31m- savePrefs_App_(d);[m [31m- saveState_App_(d, iTrue);[m [31m- break;[m [31m- }[m case SDL_DROPFILE: {[m if (isDesktop_Platform() && !d->window) {[m /* Need to open an empty window now. */[m [36m@@ -2334,7 +2345,6 @@[m [mvoid processEvents_App(enum iAppEventMode eventMode) {[m memcpy(&ev, &pendingMotion_, sizeof(pendingMotion_));[m SDL_PushEvent(&ev);[m }[m [31m- deinit_PtrArray(&windows);[m #if defined (LAGRANGE_ENABLE_IDLE_SLEEP)[m if (d->isIdling && !gotEvents) {[m /* This is where we spend most of our time when idle. The sleep delay depends on the[m [36m@@ -2344,6 +2354,7 @@[m [mvoid processEvents_App(enum iAppEventMode eventMode) {[m }[m #endif[m backToMainLoop:;[m [32m+[m[32m deinit_PtrArray(&windows);[m setCurrent_Root(oldCurrentRoot);[m }[m [m
text/gemini; charset=utf-8
This content has been proxied by September (3851b).