evolution r36168 - branches/mail-dbus-remoting/mail
- From: michael svn gnome org
- To: svn-commits-list gnome org
- Subject: evolution r36168 - branches/mail-dbus-remoting/mail
- Date: Thu, 28 Aug 2008 14:55:59 +0000 (UTC)
Author: michael
Date: Thu Aug 28 14:55:58 2008
New Revision: 36168
URL: http://svn.gnome.org/viewvc/evolution?rev=36168&view=rev
Log:
fix crash
Modified:
branches/mail-dbus-remoting/mail/camel-store-remote-impl.c
branches/mail-dbus-remoting/mail/camel-store-remote.c
Modified: branches/mail-dbus-remoting/mail/camel-store-remote-impl.c
==============================================================================
--- branches/mail-dbus-remoting/mail/camel-store-remote-impl.c (original)
+++ branches/mail-dbus-remoting/mail/camel-store-remote-impl.c Thu Aug 28 14:55:58 2008
@@ -110,16 +110,15 @@
folder = camel_store_get_folder(store, folder_name, flags, ex);
if (!folder) {
err = g_strdup(camel_exception_get_description(ex));
+ folder_hash_key = g_strdup ("");
} else {
err = g_strdup("");
- /* FIXME: Free all */
folder_hash_key =
e_dbus_get_folder_hash(camel_service_get_url
((CamelService *) folder->
parent_store),
folder->full_name);
- g_hash_table_insert(folder_hash, folder_hash_key,
- folder);
+ g_hash_table_insert(folder_hash, g_strdup (folder_hash_key), folder);
printf("Adding to hash %p: %s: %p\n", folder_hash, folder_hash_key, folder);
}
camel_exception_free(ex);
Modified: branches/mail-dbus-remoting/mail/camel-store-remote.c
==============================================================================
--- branches/mail-dbus-remoting/mail/camel-store-remote.c (original)
+++ branches/mail-dbus-remoting/mail/camel-store-remote.c Thu Aug 28 14:55:58 2008
@@ -17,23 +17,28 @@
CamelException *ex)
{
DBusError error;
- char *err;
- char *shash;
+ char *err = NULL, *shash = NULL;
+ CamelFolder *folder = NULL;
CamelFolder *folder;
dbus_error_init(&error);
/* Invoke the appropriate dbind call to CamelStoreGetFolder */
- dbind_context_method_call(evolution_dbus_peek_context(),
- CAMEL_DBUS_NAME,
- CAMEL_STORE_OBJECT_PATH,
- CAMEL_STORE_INTERFACE,
- "camel_store_get_folder",
- &error,
- "ssu=>ss", store->object_id, folder_name,
- flags, &shash, &err);
-
- folder = g_hash_table_lookup(folder_hash, shash);
+ if (dbind_context_method_call(evolution_dbus_peek_context(),
+ CAMEL_DBUS_NAME,
+ CAMEL_STORE_OBJECT_PATH,
+ CAMEL_STORE_INTERFACE,
+ "camel_store_get_folder",
+ &error,
+ "ssu=>ss", store->object_id, folder_name,
+ flags, &shash, &err))
+ folder = g_hash_table_lookup (folder_hash, shash);
+ else {
+ g_warning ("camel_store_get_folder error: %s\n", error.message);
+ dbus_error_free (&error);
+ }
+
printf("Back folder %p: %s: %p\n", folder_hash, shash, folder);
+
return folder;
}
@@ -385,6 +390,8 @@
DBusError error;
char *url;
+ g_return_val_if_fail (store != NULL, NULL);
+
dbus_error_init(&error);
ret = dbind_context_method_call(evolution_dbus_peek_context(),
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]