[gupnp/wip/phako/reusable-service-action: 44/49] ServiceProxy: Do not leak cancellable in sync call




commit d7480ce693df0837f39bcfff6da823c5910ce44c
Author: Jens Georg <mail jensge org>
Date:   Sat May 29 01:47:19 2021 +0200

    ServiceProxy: Do not leak cancellable in sync call

 libgupnp/gupnp-service-proxy.c | 5 +++++
 1 file changed, 5 insertions(+)
---
diff --git a/libgupnp/gupnp-service-proxy.c b/libgupnp/gupnp-service-proxy.c
index d7d18ac..56d7522 100644
--- a/libgupnp/gupnp-service-proxy.c
+++ b/libgupnp/gupnp-service-proxy.c
@@ -2163,6 +2163,11 @@ gupnp_service_proxy_call_action (GUPnPServiceProxy       *proxy,
         session = gupnp_context_get_session (context);
         soup_session_send_message (session, action->msg);
 
+        g_cancellable_disconnect (action->cancellable,
+                                  action->cancellable_connection_id);
+        action->cancellable_connection_id = 0;
+        g_clear_object (&action->cancellable);
+
         /* If not allowed, try again */
         if (action->msg->status_code == SOUP_STATUS_METHOD_NOT_ALLOWED) {
                 update_message_after_not_allowed (action->msg);


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