Simplify window purging procedure 20/317720/1
authorArtur Świgoń <a.swigon@samsung.com>
Tue, 28 May 2024 11:59:38 +0000 (13:59 +0200)
committerSeoyeon Kim <seoyeon2.kim@samsung.com>
Tue, 7 Jan 2025 05:03:16 +0000 (14:03 +0900)
The checks during window destruction are mostly redundant. Also add a recursion
guard to purge_windows_list.

Change-Id: I90170a145737f742f3c77627da547903f7d8b4c5

src/window_tracker.c

index 5d633a839958b16bf586bbdc32405a999534ba45..37693a0d9f23cfc94c574a5bfa1d0178b8f2baf2 100644 (file)
@@ -108,6 +108,13 @@ static Eina_Bool _window_need_to_be_purged(WindowInfo *wi)
 
 static void _purge_windows_list(WindowTrackerData *wtd)
 {
+       static Eina_Bool is_purging = EINA_FALSE;
+
+       if (is_purging)
+               return;
+
+       is_purging = EINA_TRUE;
+
        DEBUG("purging");
        WindowInfo *wi;
        Eina_List *l, *l_prev;
@@ -150,6 +157,8 @@ static void _purge_windows_list(WindowTrackerData *wtd)
                if (!wi_top)
                        app_tracker_null_context_switch(wtd->user_data);
        }
+
+       is_purging = EINA_FALSE;
 }
 
 static void _window_info_print(WindowInfo *wi)