Signal disconnect in pygobject



Hello,

In pygtk, do I need to disconnect signal (event) handlers for cleanup? Does it cause memory leaks if  I don't disconnect handlers?

In pygobject_connect() function in pygobject.c, it seems call pygobject_watch_closure.

 * Adds a closure to the list of watched closures for the wrapper.
 * The closure must be one returned by pyg_closure_new().  When the
 * cycle GC traverses the wrapper instance, it will enumerate the
 * references to Python objects stored in watched closures.  If the
 * cycle GC tells the wrapper to clear itself, the watched closures
 * will be invalidated

Does this mean that when a GObject instance is freed, connected signal handlers are automatically freed?

Thansk,
Kwang Yul Seo


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