|
From: Chris F. <cd...@fo...> - 2009-09-18 03:42:13
|
On Thu, Sep 17, 2009 at 09:17:03PM -0400, Chris Frey wrote:
> OSyncXMLField *convert_vcal_rrule_to_xml(OSyncXMLFormat *xmlformat, VFormatAttribute *attr, const char *rulename, OSyncError **error)
> @@ -305,6 +312,7 @@ static char *convert_rrule_vcal_until(const char *until_utc)
> {
> int offset = 0;
> char *until = NULL;
> + OSyncError *error = NULL;
>
>
[...]
> + until = osync_time_vtime2localtime(until_utc, offset, &error);
> +
> + if( error != NULL ) {
> + osync_trace(TRACE_ERROR, "%s: %s" , __func__, osync_error_print(&error));
> + osync_error_unref(&error);
> + }
Just to refresh my memory, I know that in the usage above, I'm responsible
for unref'ing the error, since I'm the only one that sees it.
But if an OSyncError **error is passed in to my function, am I still
responsible for unref'ing it? This almost seems like the responsibility
of the calling code, but in the sample plugin, the error is unref'd
even inside get_sync_info(). I don't know why the pointer is being passed
in if I'm responsible for unref'ing it.
Thanks,
- Chris
|