diff options
author | Olivier CrĂȘte <olivier.crete@collabora.com> | 2020-09-18 18:18:31 -0400 |
---|---|---|
committer | Olivier CrĂȘte <olivier.crete@collabora.com> | 2020-09-18 18:18:31 -0400 |
commit | a7c88d06beb9aab85a2e9c701e3244dc597a4f9d (patch) | |
tree | 94521c47e6ef2af18494c2d03ecced098960918e | |
parent | 61137b8a73a5734902a4a24caeae6312adfd85f4 (diff) | |
download | gupnp-igd-a7c88d06beb9aab85a2e9c701e3244dc597a4f9d.tar.gz |
gupnp-simple-igd: Check status of actual cancellable
It seems that sometimes GUPnP doesn't set the action as cancelled even
if the cancellable has been cancelled. So in this case, just check it ourselves
-rw-r--r-- | libgupnp-igd/gupnp-simple-igd.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/libgupnp-igd/gupnp-simple-igd.c b/libgupnp-igd/gupnp-simple-igd.c index 1517981..e300d3e 100644 --- a/libgupnp-igd/gupnp-simple-igd.c +++ b/libgupnp-igd/gupnp-simple-igd.c @@ -813,6 +813,12 @@ _service_proxy_added_port_mapping (GObject *source_object, GAsyncResult *res, GUPnPSimpleIgd *self; GError *error = NULL; + /* This is a hack, but wek now that "res" is actually implemented as a GTask, + * we're just too lazy to carry our own reference counted structure + */ + if (g_cancellable_is_cancelled (g_task_get_cancellable (G_TASK (res)))) + return; + action = gupnp_service_proxy_call_action_finish (proxy, res, &error); if (action == NULL && |