GSource object lifetime



trying to stop a memory leak (2.24.1 x86_64)... 

I'm repetitively calling g_idle_source_new(), g_source_set_callback(),
g_source_attach() to get an idle callback to run in a separate thread. The
callback in question always exits with FALSE. 

The docs for GSourceFunc() state:
...
Returns :
        it should return FALSE if the source should be removed.
...


Does "removed" mean "frees up the idle source", or just "undoes the
g_source_attach()"? 

Should I be trying to reuse the idle source? I was destroying and
recreating a time out source, but finally gave that up and just let it tick
all the time. That stopped a leak in another program so that's why I was
wondering...

-- 
www.thomasstover.com
FLYNN LIVES!



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