[gnome-games/gnome-2-28] aisleriot: maemo: Run GC on memory pressure



commit 0c89045f453d9fd1494ac0e789565baa9b9e4341
Author: Christian Persch <chpe gnome org>
Date:   Fri Nov 27 20:16:24 2009 +0100

    aisleriot: maemo: Run GC on memory pressure
    
    Try to free up some memory by running the garbage collector.
    Part of bug #574182.
    (cherry picked from commit 806ef674101b9e61bcd2fdc53ebc94ed37ad11a3)

 aisleriot/sol.c |    8 +++++++-
 1 files changed, 7 insertions(+), 1 deletions(-)
---
diff --git a/aisleriot/sol.c b/aisleriot/sol.c
index dda7e36..f72c1a2 100644
--- a/aisleriot/sol.c
+++ b/aisleriot/sol.c
@@ -153,11 +153,17 @@ osso_hw_event_cb (osso_hw_state_t *state,
   if (data->program == NULL)
     return;
 
+  games_conf_save ();
+
+  if (state->memory_low_ind) {
+    /* Run garbage collection */
+    scm_gc ();
+  }
+
 #if GNOME_ENABLE_DEBUG
   if (state->shutdown_ind) {
     g_print ("Going to shut down\n");
   } else if (state->save_unsaved_data_ind) {
-    g_print ("Should save unsaved data\n");
   } else if (state->memory_low_ind) {
     g_print ("Should try to free some memory\n");
   } else if (state->system_inactivity_ind) {



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]