Re: TnyIdleStopper
- From: Philip Van Hoof <spam pvanhoof be>
- To: Murray Cumming <murrayc murrayc com>
- Cc: tinymail-devel-list <tinymail-devel-list gnome org>
- Subject: Re: TnyIdleStopper
- Date: Fri, 04 May 2007 13:09:37 +0200
On Fri, 2007-05-04 at 12:09 +0200, Murray Cumming wrote:
> As discussed on IRC, tinymail has a problem with the 2 refresh callbacks
> given to tny_folder_refresh_async(). The status callback is sometimes
> called after the main callback, because tinymail uses different
> g_idle_add_full() priorities.
>
> This causes modest to crash when quickly clicking on different folders.
>
> This patch adds a generic TnyIdleStopper API that allows the main
> callback to tell the status callback to stop. It uses a refcount to
> decide when to release the shared gboolean (and the shared refcount). I
> suspect that we should use it for other callbacks too, so I'd like to
> put it in separeate .h/.c files.
Yes, we need to fix the other callbacks this way too. Although I think
there's only that needs this one right now, more will be added.
> I worry a bit that I am missing some simpler implementation but this API
> at least looks quite straightforward to use. It seems to fix the crash
> and the valgrind error.
Looks good, please commit but do test this one often.
--
Philip Van Hoof, software developer
home: me at pvanhoof dot be
gnome: pvanhoof at gnome dot org
http://www.pvanhoof.be/blog
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]