[maemo-commits] [maemo-commits] r18332 - projects/haf/trunk/hildon-thumbnail/daemon

From: subversion at stage.maemo.org subversion at stage.maemo.org
Date: Tue May 12 15:00:00 EEST 2009
Author: pvanhoof
Date: 2009-05-12 14:59:47 +0300 (Tue, 12 May 2009)
New Revision: 18332

Modified:
   projects/haf/trunk/hildon-thumbnail/daemon/hildon-thumbnail-daemon.c
Log:
Bugfix whem lowmemlim is too big

Modified: projects/haf/trunk/hildon-thumbnail/daemon/hildon-thumbnail-daemon.c
===================================================================
--- projects/haf/trunk/hildon-thumbnail/daemon/hildon-thumbnail-daemon.c	2009-05-12 11:30:38 UTC (rev 18331)
+++ projects/haf/trunk/hildon-thumbnail/daemon/hildon-thumbnail-daemon.c	2009-05-12 11:59:47 UTC (rev 18332)
@@ -454,6 +454,7 @@
 		DBusGProxy *manager_proxy;
 		GFile *file, *fileo;
 		GFileMonitor *monitor, *monitoro;
+		gint lowmemlim;
 
 		thumbnail_manager_do_init (connection, &manager, &error);
 		thumbnailer_do_init (connection, manager, &thumbnailer, &error);
@@ -489,13 +490,17 @@
 				       main_loop);
 
 #ifdef HAVE_OSSO
-		if (0 == osso_mem_saw_enable(osso_mem_get_lowmem_limit() >> 3, 1024, thumbnailer_oom_func, NULL) ) {
+		lowmemlim = osso_mem_get_lowmem_limit ();
+		if (lowmemlim > 0 && lowmemlim < 512) {
+			if (0 == osso_mem_saw_enable(lowmemlim >> 3, 1024, thumbnailer_oom_func, NULL) ) {
+				g_main_loop_run (main_loop);
+				osso_mem_saw_disable();
+			}
+			else {
+				thumbnailer_oom();
+			}
+		} else
 			g_main_loop_run (main_loop);
-			osso_mem_saw_disable();
-		}
-		else {
-			thumbnailer_oom();
-		}
 #else
 		g_main_loop_run (main_loop);
 #endif


More information about the maemo-commits mailing list