g_object_unref (win);
gtk_main ();
- retval = 1;
+ retval = 0;
cleanup:
gdk_threads_leave ();
- if (!modest_init_uninit ())
+ if (!modest_init_uninit ()) {
g_printerr ("modest: modest_init_uninit failed\n");
-
+ retval = 1;
+ }
+
+ g_debug ("closing modest with retval %d", retval);
+
return retval;
}
/**
- * modest_runtime_init_ui:
- * @argc: the #argc argument to the main function
- * @argv: the #argv argument to the main function
- *
- * initialize the modest UI; this replaces the call to
- * gtk_init
- *
- * TRUE if this succeeded, FALSE otherwise.
- */
-gboolean modest_runtime_init_ui (gint argc, gchar** argv);
-
-/**
* modest_runtime_uinit:
*
* uninitialize the modest runtime system; free all the
* TRUE if this succeeded, FALSE otherwise
*/
gboolean modest_runtime_uninit (void);
-
/**
{
GSList *cursor = accounts;
- g_printerr ("modest: DEBUG disconnecting all accounts\n");
while (cursor) {
if (TNY_IS_CAMEL_ACCOUNT(cursor->data)) /* check twice... */
tny_camel_account_set_online (TNY_CAMEL_ACCOUNT(cursor->data), FALSE, NULL);
}
/* disconnect all accounts when we are destroyed */
+ g_debug ("modest: disconnecting all store accounts");
account_list_disconnect (priv->store_accounts);
+ g_debug ("modest: disconnecting all transport accounts");
account_list_disconnect (priv->transport_accounts);
/* this includes the local folder */
modest_osso_save_state();
#endif /* MODEST_PLATFORM_MAEMO */
- /* FIXME: we need to cancel all actions/threads here,
- so we really quit */
+ g_debug ("closing down, clearing %d item(s) from operation queue",
+ modest_mail_operation_queue_num_elements
+ (modest_runtime_get_mail_operation_queue()));
+
+ /* cancel all outstanding operations */
+ modest_mail_operation_queue_cancel_all
+ (modest_runtime_get_mail_operation_queue());
+
+ g_debug ("queue has been cleared");
+
+ /* note: when modest-tny-account-store is finalized,
+ it will automatically set all network connections
+ to offline */
gtk_main_quit ();
}