[PATCH 3/7] Add phonebook_req_cancel to tracker

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Add phonebook_req_cancel function to phonebook_tracker.c that cancels
pending request and deallocates memory of requst object.
---
 plugins/phonebook-tracker.c |   16 ++++++++++++++++
 1 files changed, 16 insertions(+), 0 deletions(-)

diff --git a/plugins/phonebook-tracker.c b/plugins/phonebook-tracker.c
index afe0f2f..6ee5750 100644
--- a/plugins/phonebook-tracker.c
+++ b/plugins/phonebook-tracker.c
@@ -1803,6 +1803,22 @@ done:
 	return path;
 }
 
+void phonebook_req_cancel(void *request)
+{
+	struct phonebook_req *req = request;
+
+	if (!req)
+		return;
+
+	if (req->call) {
+		dbus_pending_call_cancel(req->call);
+		dbus_pending_call_unref(req->call);
+	}
+
+	g_free(req);
+	req = NULL;
+}
+
 int phonebook_pull(const char *name, const struct apparam_field *params,
 					phonebook_cb cb, void *user_data)
 {
-- 
1.7.0.4

--
To unsubscribe from this list: send the line "unsubscribe linux-bluetooth" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Bluez Devel]     [Linux Wireless Networking]     [Linux Wireless Personal Area Networking]     [Linux ATH6KL]     [Linux USB Devel]     [Linux Media Drivers]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Big List of Linux Books]

  Powered by Linux