Re: glib 2.34 g_main_context_unref hangs



On 01/17/2013 01:58 PM, Dan Winship wrote:
g_main_context_default() does not give you a ref on the default context,
so your code here is destroying an object internal to glib. If you call
this more than once (or, if you do *anything* involving the default
context after this point), I'd definitely expect it to fail.

Beyond that, it's hard to say what you might be doing wrong without
seeing more code.


Odd that it worked all these years, it is something I can easily change on my end--only un_ref'ing the context
on the 'non main' main loop.

However...

For some reason I was under the impression it gave me a reference, particularly because when I look at that default context, its ref_count is 1, not 0. My clean up routine is the last thing executed before exit(), so wouldn't this mean there is a memory leak? I guess it is not a big deal since it can only happen for the first main loop context so
there is only a single context left allocated before exit().


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