From 4c7783f32e779572ef6c421463b5ca04fd09a477 Mon Sep 17 00:00:00 2001

From: =?UTF-8?q?Jaakko=20Kera=CC=88nen?= jaakko.keranen@iki.fi

Date: Sun, 13 Oct 2024 08:11:23 +0300

Subject: [PATCH 1/1] iOS: Handling app termination

When the system terminates the app, ensure that it first deinitializes

everything immediately.


src/app.c | 29 ++++++++++++++++++++---------

1 file changed, 20 insertions(+), 9 deletions(-)

diff --git a/src/app.c b/src/app.c

index b4ce8a81..21b1f803 100644

--- a/src/app.c

+++ b/src/app.c

@@ -1498,6 +1498,9 @@ static void init_App_(iApp *d, int argc, char **argv) {

}

static void deinit_App(iApp *d) {

#if defined (iPlatformAppleDesktop) && defined (LAGRANGE_NATIVE_MENU)

 delete_Root(d->submenuRoot);

#endif

@@ -1560,6 +1563,7 @@ static void deinit_App(iApp *d) {

 iRelease(d->recentlySubmittedInput);

 iRelease(d->recentlyClosedTabUrls);

 iRelease(d->tempFilesPendingDeletion);

}

const iString *execPath_App(void) {

@@ -1961,6 +1965,21 @@ void processEvents_App(enum iAppEventMode eventMode) {

                 processEvents_App(postedEventsOnly_AppEventMode);

             }

             goto backToMainLoop;

+#if defined (iPlatformAppleMobile)

+#else

+#endif

         case SDL_APP_LOWMEMORY:

             clearCache_App_();

             break;

@@ -2000,14 +2019,6 @@ void processEvents_App(enum iAppEventMode eventMode) {

             }

             break;

         }

         case SDL_DROPFILE: {

             if (isDesktop_Platform() && !d->window) {

                 /* Need to open an empty window now. */

@@ -2334,7 +2345,6 @@ void processEvents_App(enum iAppEventMode eventMode) {

     memcpy(&ev, &pendingMotion_, sizeof(pendingMotion_));

     SDL_PushEvent(&ev);

 }

#if defined (LAGRANGE_ENABLE_IDLE_SLEEP)

 if (d->isIdling && !gotEvents) {

     /* This is where we spend most of our time when idle. The sleep delay depends on the

@@ -2344,6 +2354,7 @@ void processEvents_App(enum iAppEventMode eventMode) {

 }

#endif

backToMainLoop:;

 setCurrent_Root(oldCurrentRoot);

}

--

2.25.1

Proxy Information
Original URL
gemini://git.skyjake.fi/lagrange/release/patch/4c7783f32e779572ef6c421463b5ca04fd09a477.patch
Status Code
Success (20)
Meta
text/plain
Capsule Response Time
27.46719 milliseconds
Gemini-to-HTML Time
1.25482 milliseconds

This content has been proxied by September (ba2dc).