summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/examples/edbus/complex-types-client-eina-value.c2
-rw-r--r--src/examples/edbus/complex-types.c4
-rw-r--r--src/examples/edbus/server.c1
-rw-r--r--src/lib/edbus/edbus_freedesktop.c1
-rw-r--r--src/lib/edbus/edbus_object.c3
-rw-r--r--src/lib/edbus/edbus_pending.c12
-rw-r--r--src/lib/edbus/edbus_proxy.c11
-rw-r--r--src/lib/edbus/edbus_service.c9
-rw-r--r--src/lib/efreet/efreet_cache.c3
-rw-r--r--src/lib/ethumb/client/ethumb_client.c3
10 files changed, 17 insertions, 32 deletions
diff --git a/src/examples/edbus/complex-types-client-eina-value.c b/src/examples/edbus/complex-types-client-eina-value.c
index bf0ba902e0..cde7c9b2ce 100644
--- a/src/examples/edbus/complex-types-client-eina-value.c
+++ b/src/examples/edbus/complex-types-client-eina-value.c
@@ -291,14 +291,12 @@ main(void)
291 msg = edbus_proxy_method_call_new(proxy, "ReceiveArrayOfStringIntWithSize"); 291 msg = edbus_proxy_method_call_new(proxy, "ReceiveArrayOfStringIntWithSize");
292 _fill_receive_array_of_string_int_with_size(msg, size_of_array, array_string); 292 _fill_receive_array_of_string_int_with_size(msg, size_of_array, array_string);
293 edbus_proxy_send(proxy, msg, on_receive_array_with_size, NULL, -1); 293 edbus_proxy_send(proxy, msg, on_receive_array_with_size, NULL, -1);
294 edbus_message_unref(msg);
295 294
296 edbus_proxy_call(proxy, "SendArray", on_send_array, NULL, -1 , ""); 295 edbus_proxy_call(proxy, "SendArray", on_send_array, NULL, -1 , "");
297 296
298 msg = edbus_proxy_method_call_new(proxy, "PlusOne"); 297 msg = edbus_proxy_method_call_new(proxy, "PlusOne");
299 _fill_plus_one(msg, 14); 298 _fill_plus_one(msg, 14);
300 edbus_proxy_send(proxy, msg, on_plus_one, NULL, -1); 299 edbus_proxy_send(proxy, msg, on_plus_one, NULL, -1);
301 edbus_message_unref(msg);
302 300
303 edbus_proxy_event_callback_add(proxy, 301 edbus_proxy_event_callback_add(proxy,
304 EDBUS_PROXY_EVENT_PROPERTY_CHANGED, 302 EDBUS_PROXY_EVENT_PROPERTY_CHANGED,
diff --git a/src/examples/edbus/complex-types.c b/src/examples/edbus/complex-types.c
index 6884d0955d..e60badfaff 100644
--- a/src/examples/edbus/complex-types.c
+++ b/src/examples/edbus/complex-types.c
@@ -211,7 +211,6 @@ main(void)
211 edbus_message_iter_container_close(iter, array_of_string); 211 edbus_message_iter_container_close(iter, array_of_string);
212 pending = edbus_proxy_send(test2_proxy, msg, on_receive_array, NULL, -1); 212 pending = edbus_proxy_send(test2_proxy, msg, on_receive_array, NULL, -1);
213 if (!pending) printf("Error in edbus_proxy_send()\n\n"); 213 if (!pending) printf("Error in edbus_proxy_send()\n\n");
214 edbus_message_unref(msg);
215 214
216 msg = edbus_proxy_method_call_new(test2_proxy, "ReceiveArrayOfStringIntWithSize"); 215 msg = edbus_proxy_method_call_new(test2_proxy, "ReceiveArrayOfStringIntWithSize");
217 iter = edbus_message_iter_get(msg); 216 iter = edbus_message_iter_get(msg);
@@ -226,7 +225,6 @@ main(void)
226 } 225 }
227 edbus_message_iter_container_close(iter, array_of_string); 226 edbus_message_iter_container_close(iter, array_of_string);
228 pending = edbus_proxy_send(test2_proxy, msg, on_receive_array_with_size, NULL, -1); 227 pending = edbus_proxy_send(test2_proxy, msg, on_receive_array_with_size, NULL, -1);
229 edbus_message_unref(msg);
230 228
231 msg = edbus_proxy_method_call_new(test2_proxy, "SendVariantData"); 229 msg = edbus_proxy_method_call_new(test2_proxy, "SendVariantData");
232 iter = edbus_message_iter_get(msg); 230 iter = edbus_message_iter_get(msg);
@@ -234,7 +232,6 @@ main(void)
234 edbus_message_iter_basic_append(variant, 's', "test"); 232 edbus_message_iter_basic_append(variant, 's', "test");
235 edbus_message_iter_container_close(iter, variant); 233 edbus_message_iter_container_close(iter, variant);
236 pending = edbus_proxy_send(test2_proxy, msg, on_send_variant, NULL, -1); 234 pending = edbus_proxy_send(test2_proxy, msg, on_send_variant, NULL, -1);
237 edbus_message_unref(msg);
238 235
239 msg = edbus_proxy_method_call_new(test2_proxy, "DoubleContainner"); 236 msg = edbus_proxy_method_call_new(test2_proxy, "DoubleContainner");
240 iter = edbus_message_iter_get(msg); 237 iter = edbus_message_iter_get(msg);
@@ -260,7 +257,6 @@ main(void)
260 } 257 }
261 edbus_message_iter_container_close(iter, array_itr); 258 edbus_message_iter_container_close(iter, array_itr);
262 edbus_proxy_send(test2_proxy, msg, NULL, NULL, -1); 259 edbus_proxy_send(test2_proxy, msg, NULL, NULL, -1);
263 edbus_message_unref(msg);
264 260
265 pending = edbus_proxy_call(test2_proxy, "SendArrayInt", on_send_array_int, NULL, 261 pending = edbus_proxy_call(test2_proxy, "SendArrayInt", on_send_array_int, NULL,
266 -1 , ""); 262 -1 , "");
diff --git a/src/examples/edbus/server.c b/src/examples/edbus/server.c
index 45eeab8c22..dd606bd6b1 100644
--- a/src/examples/edbus/server.c
+++ b/src/examples/edbus/server.c
@@ -130,7 +130,6 @@ _resp_async(void *data)
130 EDBus_Message *msg = data; 130 EDBus_Message *msg = data;
131 edbus_message_arguments_append(msg, "s", "Async test ok"); 131 edbus_message_arguments_append(msg, "s", "Async test ok");
132 edbus_connection_send(conn, msg, NULL, NULL, -1); 132 edbus_connection_send(conn, msg, NULL, NULL, -1);
133 edbus_message_unref(msg);
134 return ECORE_CALLBACK_CANCEL; 133 return ECORE_CALLBACK_CANCEL;
135} 134}
136 135
diff --git a/src/lib/edbus/edbus_freedesktop.c b/src/lib/edbus/edbus_freedesktop.c
index bf5c50d3d3..716dcbcf22 100644
--- a/src/lib/edbus/edbus_freedesktop.c
+++ b/src/lib/edbus/edbus_freedesktop.c
@@ -78,6 +78,5 @@ edbus_object_managed_objects_get(EDBus_Object *obj, EDBus_Message_Cb cb, const v
78 msg = edbus_object_method_call_new(obj, EDBUS_FDO_INTERFACE_OBJECT_MANAGER, 78 msg = edbus_object_method_call_new(obj, EDBUS_FDO_INTERFACE_OBJECT_MANAGER,
79 "GetManagedObjects"); 79 "GetManagedObjects");
80 p = edbus_object_send(obj, msg, cb, data, -1); 80 p = edbus_object_send(obj, msg, cb, data, -1);
81 edbus_message_unref(msg);
82 return p; 81 return p;
83} 82}
diff --git a/src/lib/edbus/edbus_object.c b/src/lib/edbus/edbus_object.c
index c887eb6056..d61a74a9ab 100644
--- a/src/lib/edbus/edbus_object.c
+++ b/src/lib/edbus/edbus_object.c
@@ -648,7 +648,6 @@ edbus_object_peer_ping(EDBus_Object *obj, EDBus_Message_Cb cb, const void *data)
648 EDBUS_OBJECT_CHECK_RETVAL(obj, NULL); 648 EDBUS_OBJECT_CHECK_RETVAL(obj, NULL);
649 msg = edbus_object_method_call_new(obj, EDBUS_FDO_INTEFACE_PEER, "Ping"); 649 msg = edbus_object_method_call_new(obj, EDBUS_FDO_INTEFACE_PEER, "Ping");
650 p = edbus_object_send(obj, msg, cb, data, -1); 650 p = edbus_object_send(obj, msg, cb, data, -1);
651 edbus_message_unref(msg);
652 return p; 651 return p;
653} 652}
654 653
@@ -661,7 +660,6 @@ edbus_object_peer_machine_id_get(EDBus_Object *obj, EDBus_Message_Cb cb, const v
661 msg = edbus_object_method_call_new(obj, EDBUS_FDO_INTEFACE_PEER, 660 msg = edbus_object_method_call_new(obj, EDBUS_FDO_INTEFACE_PEER,
662 "GetMachineId"); 661 "GetMachineId");
663 p = edbus_object_send(obj, msg, cb, data, -1); 662 p = edbus_object_send(obj, msg, cb, data, -1);
664 edbus_message_unref(msg);
665 return p; 663 return p;
666} 664}
667 665
@@ -674,6 +672,5 @@ edbus_object_introspect(EDBus_Object *obj, EDBus_Message_Cb cb, const void *data
674 msg = edbus_object_method_call_new(obj, EDBUS_FDO_INTERFACE_INTROSPECTABLE, 672 msg = edbus_object_method_call_new(obj, EDBUS_FDO_INTERFACE_INTROSPECTABLE,
675 "Introspect"); 673 "Introspect");
676 p = edbus_object_send(obj, msg, cb, data, -1); 674 p = edbus_object_send(obj, msg, cb, data, -1);
677 edbus_message_unref(msg);
678 return p; 675 return p;
679} 676}
diff --git a/src/lib/edbus/edbus_pending.c b/src/lib/edbus/edbus_pending.c
index 99afc6f29f..bd609b240d 100644
--- a/src/lib/edbus/edbus_pending.c
+++ b/src/lib/edbus/edbus_pending.c
@@ -103,17 +103,22 @@ edbus_connection_send(EDBus_Connection *conn, EDBus_Message *msg, EDBus_Message_
103 return pending; 103 return pending;
104} 104}
105 105
106/*
107 * On success @param msg is unref'd or its ref is stolen by the returned
108 * EDBus_Pending.
109 */
106EDBus_Pending * 110EDBus_Pending *
107_edbus_connection_send(EDBus_Connection *conn, EDBus_Message *msg, EDBus_Message_Cb cb, const void *cb_data, double timeout) 111_edbus_connection_send(EDBus_Connection *conn, EDBus_Message *msg, EDBus_Message_Cb cb, const void *cb_data, double timeout)
108{ 112{
109 EDBus_Pending *pending; 113 EDBus_Pending *pending;
110 EDBus_Message *error_msg; 114 EDBus_Message *error_msg;
111 DBG("conn=%p, msg=%p, cb=%p, cb_data=%p, timeout=%f", 115 DBG("conn=%p, msg=%p, cb=%p, cb_data=%p, timeout=%f",
112 conn, msg, cb, cb_data, timeout); 116 conn, msg, cb, cb_data, timeout);
113 117
114 if (!cb) 118 if (!cb)
115 { 119 {
116 dbus_connection_send(conn->dbus_conn, msg->dbus_msg, NULL); 120 dbus_connection_send(conn->dbus_conn, msg->dbus_msg, NULL);
121 edbus_message_unref(msg);
117 return NULL; 122 return NULL;
118 } 123 }
119 124
@@ -127,7 +132,10 @@ _edbus_connection_send(EDBus_Connection *conn, EDBus_Message *msg, EDBus_Message
127 pending->interface = eina_stringshare_add(dbus_message_get_interface(msg->dbus_msg)); 132 pending->interface = eina_stringshare_add(dbus_message_get_interface(msg->dbus_msg));
128 pending->method = eina_stringshare_add(dbus_message_get_member(msg->dbus_msg)); 133 pending->method = eina_stringshare_add(dbus_message_get_member(msg->dbus_msg));
129 pending->path = eina_stringshare_add(dbus_message_get_path(msg->dbus_msg)); 134 pending->path = eina_stringshare_add(dbus_message_get_path(msg->dbus_msg));
130 pending->msg_sent = edbus_message_ref(msg); 135
136 /* Steal the reference */
137 pending->msg_sent = msg;
138
131 EINA_MAGIC_SET(pending, EDBUS_PENDING_MAGIC); 139 EINA_MAGIC_SET(pending, EDBUS_PENDING_MAGIC);
132 140
133 if (!dbus_connection_send_with_reply(conn->dbus_conn, 141 if (!dbus_connection_send_with_reply(conn->dbus_conn,
diff --git a/src/lib/edbus/edbus_proxy.c b/src/lib/edbus/edbus_proxy.c
index c90b91bd0c..c59a031877 100644
--- a/src/lib/edbus/edbus_proxy.c
+++ b/src/lib/edbus/edbus_proxy.c
@@ -539,7 +539,6 @@ edbus_proxy_method_call_new(EDBus_Proxy *proxy, const char *member)
539static EDBus_Pending * 539static EDBus_Pending *
540_edbus_proxy_vcall(EDBus_Proxy *proxy, const char *member, EDBus_Message_Cb cb, const void *cb_data, double timeout, const char *signature, va_list ap) 540_edbus_proxy_vcall(EDBus_Proxy *proxy, const char *member, EDBus_Message_Cb cb, const void *cb_data, double timeout, const char *signature, va_list ap)
541{ 541{
542 EDBus_Pending *pending;
543 EDBus_Message *msg = edbus_proxy_method_call_new(proxy, member); 542 EDBus_Message *msg = edbus_proxy_method_call_new(proxy, member);
544 EINA_SAFETY_ON_NULL_RETURN_VAL(msg, NULL); 543 EINA_SAFETY_ON_NULL_RETURN_VAL(msg, NULL);
545 544
@@ -550,9 +549,7 @@ _edbus_proxy_vcall(EDBus_Proxy *proxy, const char *member, EDBus_Message_Cb cb,
550 return NULL; 549 return NULL;
551 } 550 }
552 551
553 pending = _edbus_proxy_send(proxy, msg, cb, cb_data, timeout); 552 return _edbus_proxy_send(proxy, msg, cb, cb_data, timeout);
554 edbus_message_unref(msg);
555 return pending;
556} 553}
557 554
558EAPI EDBus_Pending * 555EAPI EDBus_Pending *
@@ -628,7 +625,6 @@ edbus_proxy_property_set(EDBus_Proxy *proxy, const char *name, const char *sig,
628{ 625{
629 EDBus_Message *msg; 626 EDBus_Message *msg;
630 EDBus_Message_Iter *iter, *variant; 627 EDBus_Message_Iter *iter, *variant;
631 EDBus_Pending *pending;
632 628
633 EDBUS_PROXY_CHECK_RETVAL(proxy, NULL); 629 EDBUS_PROXY_CHECK_RETVAL(proxy, NULL);
634 EINA_SAFETY_ON_NULL_RETURN_VAL(name, NULL); 630 EINA_SAFETY_ON_NULL_RETURN_VAL(name, NULL);
@@ -653,10 +649,7 @@ edbus_proxy_property_set(EDBus_Proxy *proxy, const char *name, const char *sig,
653 } 649 }
654 edbus_message_iter_container_close(iter, variant); 650 edbus_message_iter_container_close(iter, variant);
655 651
656 pending = edbus_proxy_send(proxy->obj->properties, msg, cb, data, -1); 652 return edbus_proxy_send(proxy->obj->properties, msg, cb, data, -1);
657 edbus_message_unref(msg);
658
659 return pending;
660} 653}
661 654
662EAPI EDBus_Pending * 655EAPI EDBus_Pending *
diff --git a/src/lib/edbus/edbus_service.c b/src/lib/edbus/edbus_service.c
index e83d7a48bb..d1fd8d4eee 100644
--- a/src/lib/edbus/edbus_service.c
+++ b/src/lib/edbus/edbus_service.c
@@ -729,11 +729,13 @@ _iface_changed_send(void *data)
729 ERR("msg == NULL"); 729 ERR("msg == NULL");
730 continue; 730 continue;
731 } 731 }
732
732 main_iter = edbus_message_iter_get(msg); 733 main_iter = edbus_message_iter_get(msg);
733 edbus_message_iter_arguments_append(main_iter, "oa{sa{sv}}", 734 edbus_message_iter_arguments_append(main_iter, "oa{sa{sv}}",
734 iface->obj->path, &array_iface); 735 iface->obj->path, &array_iface);
735 if (!_propmgr_iface_props_append(iface, array_iface)) 736 if (!_propmgr_iface_props_append(iface, array_iface))
736 goto error; 737 goto error;
738
737 EINA_LIST_FOREACH_SAFE(parent->iface_added, l, l2, next_iface) 739 EINA_LIST_FOREACH_SAFE(parent->iface_added, l, l2, next_iface)
738 { 740 {
739 if (iface->obj->path != next_iface->obj->path) 741 if (iface->obj->path != next_iface->obj->path)
@@ -747,6 +749,7 @@ _iface_changed_send(void *data)
747 edbus_message_iter_container_close(main_iter, array_iface); 749 edbus_message_iter_container_close(main_iter, array_iface);
748 edbus_connection_send(parent->conn, msg, NULL, NULL, -1); 750 edbus_connection_send(parent->conn, msg, NULL, NULL, -1);
749 continue; 751 continue;
752
750error: 753error:
751 ERR("Error appending InterfacesAdded to msg."); 754 ERR("Error appending InterfacesAdded to msg.");
752 edbus_message_unref(msg); 755 edbus_message_unref(msg);
@@ -770,7 +773,7 @@ error:
770 main_iter = edbus_message_iter_get(msg); 773 main_iter = edbus_message_iter_get(msg);
771 774
772 edbus_message_iter_arguments_append(main_iter, "oas", iface_data->obj_path, 775 edbus_message_iter_arguments_append(main_iter, "oas", iface_data->obj_path,
773 &array_iface); 776 &array_iface);
774 edbus_message_iter_basic_append(array_iface, 's', iface_data->iface); 777 edbus_message_iter_basic_append(array_iface, 's', iface_data->iface);
775 778
776 EINA_LIST_FOREACH_SAFE(parent->iface_removed, l, l2, iface_data_next) 779 EINA_LIST_FOREACH_SAFE(parent->iface_removed, l, l2, iface_data_next)
@@ -1196,7 +1199,6 @@ _object_handler(DBusConnection *conn EINA_UNUSED, DBusMessage *msg, void *user_d
1196 if (!reply) return DBUS_HANDLER_RESULT_HANDLED; 1199 if (!reply) return DBUS_HANDLER_RESULT_HANDLED;
1197 1200
1198 _edbus_connection_send(obj->conn, reply, NULL, NULL, -1); 1201 _edbus_connection_send(obj->conn, reply, NULL, NULL, -1);
1199 edbus_message_unref(reply);
1200 1202
1201 return DBUS_HANDLER_RESULT_HANDLED; 1203 return DBUS_HANDLER_RESULT_HANDLED;
1202} 1204}
@@ -1259,7 +1261,6 @@ edbus_service_signal_send(const EDBus_Service_Interface *iface, EDBus_Message *s
1259 EDBUS_SERVICE_INTERFACE_CHECK_RETVAL(iface, EINA_FALSE); 1261 EDBUS_SERVICE_INTERFACE_CHECK_RETVAL(iface, EINA_FALSE);
1260 EINA_SAFETY_ON_NULL_RETURN_VAL(signal_msg, EINA_FALSE); 1262 EINA_SAFETY_ON_NULL_RETURN_VAL(signal_msg, EINA_FALSE);
1261 _edbus_connection_send(iface->obj->conn, signal_msg, NULL, NULL, -1); 1263 _edbus_connection_send(iface->obj->conn, signal_msg, NULL, NULL, -1);
1262 edbus_message_unref(signal_msg);
1263 return EINA_TRUE; 1264 return EINA_TRUE;
1264} 1265}
1265 1266
diff --git a/src/lib/efreet/efreet_cache.c b/src/lib/efreet/efreet_cache.c
index 6e99ee3951..5c3a52a669 100644
--- a/src/lib/efreet/efreet_cache.c
+++ b/src/lib/efreet/efreet_cache.c
@@ -878,7 +878,6 @@ efreet_cache_desktop_add(Efreet_Desktop *desktop)
878 edbus_message_iter_basic_append(array_of_string, 's', path); 878 edbus_message_iter_basic_append(array_of_string, 's', path);
879 edbus_message_iter_container_close(iter, array_of_string); 879 edbus_message_iter_container_close(iter, array_of_string);
880 edbus_proxy_send(proxy, msg, NULL, NULL, -1); 880 edbus_proxy_send(proxy, msg, NULL, NULL, -1);
881 edbus_message_unref(msg);
882 free(path); 881 free(path);
883} 882}
884 883
@@ -898,7 +897,6 @@ efreet_cache_icon_exts_add(Eina_List *exts)
898 edbus_message_iter_basic_append(array_of_string, 's', ext); 897 edbus_message_iter_basic_append(array_of_string, 's', ext);
899 edbus_message_iter_container_close(iter, array_of_string); 898 edbus_message_iter_container_close(iter, array_of_string);
900 edbus_proxy_send(proxy, msg, NULL, NULL, -1); 899 edbus_proxy_send(proxy, msg, NULL, NULL, -1);
901 edbus_message_unref(msg);
902} 900}
903 901
904void 902void
@@ -917,7 +915,6 @@ efreet_cache_icon_dirs_add(Eina_List *dirs)
917 edbus_message_iter_basic_append(array_of_string, 's', dir); 915 edbus_message_iter_basic_append(array_of_string, 's', dir);
918 edbus_message_iter_container_close(iter, array_of_string); 916 edbus_message_iter_container_close(iter, array_of_string);
919 edbus_proxy_send(proxy, msg, NULL, NULL, -1); 917 edbus_proxy_send(proxy, msg, NULL, NULL, -1);
920 edbus_message_unref(msg);
921} 918}
922 919
923void 920void
diff --git a/src/lib/ethumb/client/ethumb_client.c b/src/lib/ethumb/client/ethumb_client.c
index cfe04887cf..9c2530323c 100644
--- a/src/lib/ethumb/client/ethumb_client.c
+++ b/src/lib/ethumb/client/ethumb_client.c
@@ -353,7 +353,6 @@ _ethumb_client_call_new(Ethumb_Client *client)
353 _ethumb_dbus_path, 353 _ethumb_dbus_path,
354 _ethumb_dbus_interface, "new"); 354 _ethumb_dbus_interface, "new");
355 edbus_connection_send(client->conn, msg, _ethumb_client_new_cb, client, -1); 355 edbus_connection_send(client->conn, msg, _ethumb_client_new_cb, client, -1);
356 edbus_message_unref(msg);
357} 356}
358 357
359static void 358static void
@@ -822,7 +821,6 @@ ethumb_client_ethumb_setup(Ethumb_Client *client)
822 821
823 edbus_proxy_send(client->proxy, msg, _ethumb_client_ethumb_setup_cb, 822 edbus_proxy_send(client->proxy, msg, _ethumb_client_ethumb_setup_cb,
824 client, -1); 823 client, -1);
825 edbus_message_unref(msg);
826} 824}
827 825
828/** 826/**
@@ -962,7 +960,6 @@ _ethumb_client_queue_add(Ethumb_Client *client, const char *file, const char *ke
962 _ethumb_client_queue_add_cb, 960 _ethumb_client_queue_add_cb,
963 pending, -1); 961 pending, -1);
964 client->pending_add = eina_list_append(client->pending_add, pending); 962 client->pending_add = eina_list_append(client->pending_add, pending);
965 edbus_message_unref(msg);
966 963
967 return pending->id; 964 return pending->id;
968} 965}