[compiz] [PATCH] Remove timeout callback

David Reveman davidr at novell.com
Mon Apr 23 08:07:40 PDT 2007


On Mon, 2007-04-23 at 14:28 +0100, Mike Dransfield wrote:
> While working on the python plugin, I realised that the
> timeout system does not allow for notification when a timeout
> is removed.  This has been fine up until now because he closures
> never needed to be cleaned up.
> 
> In the python plugin, I pass through a custom structure which
> needs to be cleaned up if the timeout is removed.  This is almost
> certainly the cause of some horrible memory leaks for me.
> 
> The attached patch is a simple solution to the problem.  I think
> it should be good enough for most situations.
> 
> I could maintain some sort of lookup inside my plugin, but I think
> other plugins would benefit from this.
> 
> It is OK to go in or were there any comments?

Timeouts are only removed as a result of the timeout call-back function
returning FALSE. So unless I'm missing something, all cleanup can be
done in the regular call-back function before returning FALSE.

- David



More information about the compiz mailing list