question about tny_camel_folder_add_msg_async_default
- From: <Dirk-Jan Binnema nokia com>
- To: <tinymail-devel-list gnome org>
- Subject: question about tny_camel_folder_add_msg_async_default
- Date: Thu, 10 Jan 2008 18:25:10 +0200
Hi,
Did some more valgrinding; I found the following, when saving
messages to draft. It seems this issue happens for all of the async
funtions in tny_camel_folder.
1) we're calling tny_folder_add_msg_async; the last parameter (callback
data) is a struct of type SaveToDraftsAddMsgInfo
(for example in modest_mail_operation_save_to_drafts_cb)
2) in tny_camel_folder_add_msg_async_default we create a new structure
'info' of type 'AddMsgFolderInfo', and
info->user_data = user_data <= this is our
SaveToDraftsAddMsgInfo
3) we're adding this info to the queue,
_tny_camel_queue_launch_wflags, and this 'user_data' is there called
'data'
Here we create yet another structure 'item' of type QueueItem, and
info->data = data <= this is our
AddMsgFolderInfo
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 sure what is the best way to fix this; one rel. easy way would be to
add the
user_data as a separate pointer. But, note that the queue api is also
used
from tny-camel-(store-)account and tny-camel-bs-mime-part, and there it
seems
the problem doesn't occur (because the functions there add there
user_data
directly to the queue, instead of going through the tny_folder_ ..
functions.
Best wishes,
Dirk.
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]