Re: question about tny_camel_folder_add_msg_async_default



Dirk-Jan Binnema nokia com wrote:

> 4) finally, we call the callback in 'perform_callback', which uses the
> QueueItem:
> 	if (item->callback)
>               retval = item->callback (item->data)
>      
>  so, we're calling our callback function with a AddMsgFolderInfo
> structure, but
>  the callback is expecting to get its SaveToDraftsAddMsgInfo. It will
> also do a 
>  g_slice_free etc., so it's easy to see how this could lead to crashes.

Not really, this item->callback is not the user callback, is the
callback that is set when calling tny_camel_queue_launch, that is, the
callback that the camel queue will call once the asynchronous operation
is finished.

In the case you mention add_msg_async the callback that it's called is
tny_camel_folder_add_msg_async_callback. This callback "unpacks" the
AddMsgFolderInfo and finally calls the user callback with the user data.

Br


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]