Re: return value for gupnp_service_proxy_begin_action in case of error
- From: Jens Georg <mail jensge org>
- To: Branislav Katreniak <branislav katreniak streamunlimited com>
- Cc: gupnp-list gnome org
- Subject: Re: return value for gupnp_service_proxy_begin_action in case of error
- Date: Wed, 08 Feb 2012 22:54:05 +0200
Sorry for the delay.
Thanks for your patch, but doesn't that leak the action in the error
case?
Also I would prefer if you filed a bug and attached the patch to that.
> Hi All
>
> Method gupnp_service_proxy_begin_action()
> Returns :
> A GUPnPServiceProxyAction handle. This will be freed when
> gupnp_service_proxy_cancel_action() or
> gupnp_service_proxy_end_action_valist(). [transfer none]
>
> This methods calls
> gupnp_service_proxy_begin_action_valist
> and
> begin_action_msg
>
> Method begin_action_msg can fail on number of reasons.
> In this case method gupnp_service_proxy_begin_action_valist calls callback
> and returns pointer to action.
>
> if (ret->error) {
> callback (proxy, ret, user_data);
>
> return ret;
> }
>
> But it is expected that callback calls gupnp_service_proxy_end_action
> and thus frees the action.
> The pointer to returned action is invalid.
> And client code starting the asynchronous action cannot use it.
>
> If think that the group of methods gupnp_service_proxy_begin_action_???
> should return 0 in this case.
> Furthermore, it should be documented that the callback was already called.
>
> Am I correct?
> Patch attached.
>
> Kind regards
> Brano
> _______________________________________________
> gupnp-list mailing list
> gupnp-list gnome org
> http://mail.gnome.org/mailman/listinfo/gupnp-list
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]