Re: TnyIdleStopper



On Fri, 2007-05-04 at 13:09 +0200, Philip Van Hoof wrote:
> 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.

Is it OK if I make small changes to the Makefile.am so that the private
header (tny-idle-stopper.h) is not installed. It might be useful for
other things too.

-- 
Murray Cumming
murrayc murrayc com
www.murrayc.com
www.openismus.com




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