Revision 9042f18c20b8066661efbf6e9f3bac34c9d2cd2e

Shkutkov Michael mish at rsu.ru
Wed Jul 11 08:27:40 EDT 2007


Will Thompson wrote:
> 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.)
>
>   
My bad. I'd prefer first way.

-- 
With best regards,
Shkutkov Michael




More information about the Devel mailing list