Revision 9042f18c20b8066661efbf6e9f3bac34c9d2cd2e

Will Thompson resiak at soc.pidgin.im
Wed Jul 11 04:37:26 EDT 2007


On Tue, Jul 10, 2007 at 06:51:42PM -0400, mshkutkov at soc.pidgin.im wrote:
> +static void purple_account_destroy_log_cb(void *data)
> +{
> +	data = NULL;
> +}
> +
>  void
>  purple_account_destroy_log(PurpleAccount *account)
>  {
>  	g_return_if_fail(account != NULL);
>  
> -	if(account->system_log){
> -		purple_log_free(account->system_log);
> -		account->system_log = NULL;
> -	}
> +	if(account->system_log)
> +		purple_log_free_nonblocking(account->system_log, purple_account_destroy_log_cb, account->system_log);
>  }

I think the intention here is to set account->system_log to NULL in the
callback, but this code does not do that.  (data is local to
purple_account_destroy_log_cb.)  You could pass account as the third
argument to purple_log_free_nonblocking, and change the body of the
callback to:

    ((PurpleAccount *) data)->system_log = NULL;

(Or I guess you could pass &(account->system_log) and have the callback
be *data = NULL but that seems unclear.)

Will
-- 
XMPP: <resiak at feayn.org>; MSN: <msn at willthompson.co.uk>




More information about the Devel mailing list