desktop-data-model r7278 - trunk/engine-dbus
- From: otaylor svn gnome org
- To: svn-commits-list gnome org
- Subject: desktop-data-model r7278 - trunk/engine-dbus
- Date: Wed, 23 Apr 2008 18:48:26 +0100 (BST)
Author: otaylor
Date: Wed Apr 23 17:48:26 2008
New Revision: 7278
URL: http://svn.gnome.org/viewvc/desktop-data-model?rev=7278&view=rev
Log:
Fix problems when client goes away while a query is pending.
Modified:
trunk/engine-dbus/hippo-dbus-model-client.c
Modified: trunk/engine-dbus/hippo-dbus-model-client.c
==============================================================================
--- trunk/engine-dbus/hippo-dbus-model-client.c (original)
+++ trunk/engine-dbus/hippo-dbus-model-client.c Wed Apr 23 17:48:26 2008
@@ -719,20 +719,22 @@
DBusMessage *reply;
GSList *l;
- reply = dbus_message_new_method_return(closure->message);
- dbus_message_iter_init_append(reply, &iter);
-
- dbus_message_iter_open_container(&iter, DBUS_TYPE_ARRAY, "(ssba(ssyyyv))", &array_iter);
-
- for (l = results; l; l = l->next) {
- add_resource_to_message(closure->client, NULL, &array_iter, l->data, closure->fetch, FALSE, NULL);
+ if (!closure->client->disconnected) {
+ reply = dbus_message_new_method_return(closure->message);
+ dbus_message_iter_init_append(reply, &iter);
+
+ dbus_message_iter_open_container(&iter, DBUS_TYPE_ARRAY, "(ssba(ssyyyv))", &array_iter);
+
+ for (l = results; l; l = l->next) {
+ add_resource_to_message(closure->client, NULL, &array_iter, l->data, closure->fetch, FALSE, NULL);
+ }
+
+ dbus_message_iter_close_container(&iter, &array_iter);
+
+ dbus_connection_send(closure->connection, reply, NULL);
+ dbus_message_unref(reply);
}
- dbus_message_iter_close_container(&iter, &array_iter);
-
- dbus_connection_send(closure->connection, reply, NULL);
- dbus_message_unref(reply);
-
data_client_query_closure_destroy(closure);
}
@@ -746,17 +748,19 @@
DBusMessageIter iter;
dbus_int32_t code = (dbus_int32_t)error;
- reply = dbus_message_new_error(closure->message,
- HIPPO_DBUS_MODEL_ERROR,
- message);
+ if (!closure->client->disconnected) {
+ reply = dbus_message_new_error(closure->message,
+ HIPPO_DBUS_MODEL_ERROR,
+ message);
- dbus_message_iter_init_append(reply, &iter);
- dbus_message_iter_append_basic(&iter, DBUS_TYPE_INT32, &code);
+ dbus_message_iter_init_append(reply, &iter);
+ dbus_message_iter_append_basic(&iter, DBUS_TYPE_INT32, &code);
- dbus_connection_send(closure->connection, reply, NULL);
- dbus_message_unref(reply);
+ dbus_connection_send(closure->connection, reply, NULL);
+ dbus_message_unref(reply);
- data_client_query_closure_destroy(closure);
+ data_client_query_closure_destroy(closure);
+ }
}
gboolean
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]