From 25809b1fab3c3e78f97c332131dab4d517187eac Mon Sep 17 00:00:00 2001 From: Sergio Villar Senin Date: Wed, 28 May 2008 11:48:44 +0000 Subject: [PATCH] * Fixes NB#85931, do not crash in D-Bus methods in memory low conditions pmo-trunk-r4578 --- src/dbus_api/modest-dbus-callbacks.c | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/src/dbus_api/modest-dbus-callbacks.c b/src/dbus_api/modest-dbus-callbacks.c index 0c155b3..c515c6b 100644 --- a/src/dbus_api/modest-dbus-callbacks.c +++ b/src/dbus_api/modest-dbus-callbacks.c @@ -1176,6 +1176,21 @@ on_top_application(GArray * arguments, gpointer data, osso_rpc_t * retval) return OSSO_OK; } + +static gboolean +on_idle_show_memory_low (gpointer user_data) +{ + ModestWindow *main_win = NULL; + + gdk_threads_enter (); + main_win = modest_window_mgr_get_main_window (modest_runtime_get_window_mgr (), FALSE); + modest_platform_run_information_dialog (GTK_WINDOW (main_win), + dgettext("ke-recv","memr_ib_operation_disabled"), + TRUE); + gdk_threads_leave (); + + return FALSE; +} /* Callback for normal D-BUS messages */ gint @@ -1183,6 +1198,12 @@ modest_dbus_req_handler(const gchar * interface, const gchar * method, GArray * arguments, gpointer data, osso_rpc_t * retval) { + /* Check memory low conditions */ + if (modest_platform_check_memory_low (NULL, FALSE)) { + g_idle_add (on_idle_show_memory_low, NULL); + goto param_error; + } + if (g_ascii_strcasecmp (method, MODEST_DBUS_METHOD_MAIL_TO) == 0) { if (arguments->len != MODEST_DBUS_MAIL_TO_ARGS_COUNT) goto param_error; -- 1.7.9.5