Re: g_main_context_depth()



On Monday 05 January 2004 16:40, Owen Taylor wrote:
>  - It's very tempting to use it in situations that aren't
>    appropriate. (The equivalent Qt function that inspired the request
>    has been deprecated, though the docs don't elaborate on why.)

I'm assuming you're talking about loopLevel here. It hasn't been really 
deprecated. We deprecated the QApplication calls, since they were only 
forwarding them to QEventLoop. QEventLoop::loopLevel isn't deprecated.

> I'd be interested to hear if other people have uses for this
> function, or if Tim wants to say a bit more on why main-looop-depth
> controlled GC is cool enough to be worth special support in GObject.

Yeah, to be honest, whenever I see it I'm expecting bugs, fortunately 
I've seen it only twice. Both times it was used to specify a hard limit 
on recursive calls of a slot. Both times the loop had to be entered 
because the slot depended on some asynchronous event to happen 
synchronously. Yeah, it's a hack but it's useful sometimes.

Zack

-- 
With reasonable men I will reason; with humane men I will plead; but to 
tyrants I will give no quarter. -- William Lloyd Garrison



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