msg = edbus_proxy_method_call_new(proxy, "ReceiveArrayOfStringIntWithSize");
_fill_receive_array_of_string_int_with_size(msg, size_of_array, array_string);
edbus_proxy_send(proxy, msg, on_receive_array_with_size, NULL, -1);
- edbus_message_unref(msg);
edbus_proxy_call(proxy, "SendArray", on_send_array, NULL, -1 , "");
msg = edbus_proxy_method_call_new(proxy, "PlusOne");
_fill_plus_one(msg, 14);
edbus_proxy_send(proxy, msg, on_plus_one, NULL, -1);
- edbus_message_unref(msg);
edbus_proxy_event_callback_add(proxy,
EDBUS_PROXY_EVENT_PROPERTY_CHANGED,
edbus_message_iter_container_close(iter, array_of_string);
pending = edbus_proxy_send(test2_proxy, msg, on_receive_array, NULL, -1);
if (!pending) printf("Error in edbus_proxy_send()\n\n");
- edbus_message_unref(msg);
msg = edbus_proxy_method_call_new(test2_proxy, "ReceiveArrayOfStringIntWithSize");
iter = edbus_message_iter_get(msg);
}
edbus_message_iter_container_close(iter, array_of_string);
pending = edbus_proxy_send(test2_proxy, msg, on_receive_array_with_size, NULL, -1);
- edbus_message_unref(msg);
msg = edbus_proxy_method_call_new(test2_proxy, "SendVariantData");
iter = edbus_message_iter_get(msg);
edbus_message_iter_basic_append(variant, 's', "test");
edbus_message_iter_container_close(iter, variant);
pending = edbus_proxy_send(test2_proxy, msg, on_send_variant, NULL, -1);
- edbus_message_unref(msg);
msg = edbus_proxy_method_call_new(test2_proxy, "DoubleContainner");
iter = edbus_message_iter_get(msg);
}
edbus_message_iter_container_close(iter, array_itr);
edbus_proxy_send(test2_proxy, msg, NULL, NULL, -1);
- edbus_message_unref(msg);
pending = edbus_proxy_call(test2_proxy, "SendArrayInt", on_send_array_int, NULL,
-1 , "");
EDBus_Message *msg = data;
edbus_message_arguments_append(msg, "s", "Async test ok");
edbus_connection_send(conn, msg, NULL, NULL, -1);
- edbus_message_unref(msg);
return ECORE_CALLBACK_CANCEL;
}
msg = edbus_object_method_call_new(obj, EDBUS_FDO_INTERFACE_OBJECT_MANAGER,
"GetManagedObjects");
p = edbus_object_send(obj, msg, cb, data, -1);
- edbus_message_unref(msg);
return p;
}
EDBUS_OBJECT_CHECK_RETVAL(obj, NULL);
msg = edbus_object_method_call_new(obj, EDBUS_FDO_INTEFACE_PEER, "Ping");
p = edbus_object_send(obj, msg, cb, data, -1);
- edbus_message_unref(msg);
return p;
}
msg = edbus_object_method_call_new(obj, EDBUS_FDO_INTEFACE_PEER,
"GetMachineId");
p = edbus_object_send(obj, msg, cb, data, -1);
- edbus_message_unref(msg);
return p;
}
msg = edbus_object_method_call_new(obj, EDBUS_FDO_INTERFACE_INTROSPECTABLE,
"Introspect");
p = edbus_object_send(obj, msg, cb, data, -1);
- edbus_message_unref(msg);
return p;
}
return pending;
}
+/*
+ * On success @param msg is unref'd or its ref is stolen by the returned
+ * EDBus_Pending.
+ */
EDBus_Pending *
_edbus_connection_send(EDBus_Connection *conn, EDBus_Message *msg, EDBus_Message_Cb cb, const void *cb_data, double timeout)
{
EDBus_Pending *pending;
EDBus_Message *error_msg;
DBG("conn=%p, msg=%p, cb=%p, cb_data=%p, timeout=%f",
- conn, msg, cb, cb_data, timeout);
+ conn, msg, cb, cb_data, timeout);
if (!cb)
{
dbus_connection_send(conn->dbus_conn, msg->dbus_msg, NULL);
+ edbus_message_unref(msg);
return NULL;
}
pending->interface = eina_stringshare_add(dbus_message_get_interface(msg->dbus_msg));
pending->method = eina_stringshare_add(dbus_message_get_member(msg->dbus_msg));
pending->path = eina_stringshare_add(dbus_message_get_path(msg->dbus_msg));
- pending->msg_sent = edbus_message_ref(msg);
+
+ /* Steal the reference */
+ pending->msg_sent = msg;
+
EINA_MAGIC_SET(pending, EDBUS_PENDING_MAGIC);
if (!dbus_connection_send_with_reply(conn->dbus_conn,
static EDBus_Pending *
_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)
{
- EDBus_Pending *pending;
EDBus_Message *msg = edbus_proxy_method_call_new(proxy, member);
EINA_SAFETY_ON_NULL_RETURN_VAL(msg, NULL);
return NULL;
}
- pending = _edbus_proxy_send(proxy, msg, cb, cb_data, timeout);
- edbus_message_unref(msg);
- return pending;
+ return _edbus_proxy_send(proxy, msg, cb, cb_data, timeout);
}
EAPI EDBus_Pending *
{
EDBus_Message *msg;
EDBus_Message_Iter *iter, *variant;
- EDBus_Pending *pending;
EDBUS_PROXY_CHECK_RETVAL(proxy, NULL);
EINA_SAFETY_ON_NULL_RETURN_VAL(name, NULL);
}
edbus_message_iter_container_close(iter, variant);
- pending = edbus_proxy_send(proxy->obj->properties, msg, cb, data, -1);
- edbus_message_unref(msg);
-
- return pending;
+ return edbus_proxy_send(proxy->obj->properties, msg, cb, data, -1);
}
EAPI EDBus_Pending *
ERR("msg == NULL");
continue;
}
+
main_iter = edbus_message_iter_get(msg);
edbus_message_iter_arguments_append(main_iter, "oa{sa{sv}}",
- iface->obj->path, &array_iface);
+ iface->obj->path, &array_iface);
if (!_propmgr_iface_props_append(iface, array_iface))
goto error;
+
EINA_LIST_FOREACH_SAFE(parent->iface_added, l, l2, next_iface)
{
if (iface->obj->path != next_iface->obj->path)
edbus_message_iter_container_close(main_iter, array_iface);
edbus_connection_send(parent->conn, msg, NULL, NULL, -1);
continue;
+
error:
ERR("Error appending InterfacesAdded to msg.");
edbus_message_unref(msg);
main_iter = edbus_message_iter_get(msg);
edbus_message_iter_arguments_append(main_iter, "oas", iface_data->obj_path,
- &array_iface);
+ &array_iface);
edbus_message_iter_basic_append(array_iface, 's', iface_data->iface);
EINA_LIST_FOREACH_SAFE(parent->iface_removed, l, l2, iface_data_next)
if (!reply) return DBUS_HANDLER_RESULT_HANDLED;
_edbus_connection_send(obj->conn, reply, NULL, NULL, -1);
- edbus_message_unref(reply);
return DBUS_HANDLER_RESULT_HANDLED;
}
EDBUS_SERVICE_INTERFACE_CHECK_RETVAL(iface, EINA_FALSE);
EINA_SAFETY_ON_NULL_RETURN_VAL(signal_msg, EINA_FALSE);
_edbus_connection_send(iface->obj->conn, signal_msg, NULL, NULL, -1);
- edbus_message_unref(signal_msg);
return EINA_TRUE;
}
edbus_message_iter_basic_append(array_of_string, 's', path);
edbus_message_iter_container_close(iter, array_of_string);
edbus_proxy_send(proxy, msg, NULL, NULL, -1);
- edbus_message_unref(msg);
free(path);
}
edbus_message_iter_basic_append(array_of_string, 's', ext);
edbus_message_iter_container_close(iter, array_of_string);
edbus_proxy_send(proxy, msg, NULL, NULL, -1);
- edbus_message_unref(msg);
}
void
edbus_message_iter_basic_append(array_of_string, 's', dir);
edbus_message_iter_container_close(iter, array_of_string);
edbus_proxy_send(proxy, msg, NULL, NULL, -1);
- edbus_message_unref(msg);
}
void
_ethumb_dbus_path,
_ethumb_dbus_interface, "new");
edbus_connection_send(client->conn, msg, _ethumb_client_new_cb, client, -1);
- edbus_message_unref(msg);
}
static void
edbus_proxy_send(client->proxy, msg, _ethumb_client_ethumb_setup_cb,
client, -1);
- edbus_message_unref(msg);
}
/**
_ethumb_client_queue_add_cb,
pending, -1);
client->pending_add = eina_list_append(client->pending_add, pending);
- edbus_message_unref(msg);
return pending->id;
}