Re: [gtk-vnc-devel] Thoughts about widgets



Daniel P. Berrange wrote:
On Tue, Mar 18, 2008 at 11:22:41AM -0300, Jonh Wendell wrote:
Hi, folks.

I was wondering why vncdisplay widget destroys itself. Isn't up to the
container destroy its children?

It doesn't destroy itself directly - GTK widgets are reference countered. The VNC display object increments the reference count when the coroutine
starts, and decrements it when the coroutine exits. This last action
may or may not actaully destroy the widget - it depends on whether
the parent container has already released its own reference.

We need the reference counting, because if we didn't have it, then the
container could destroy the widget while the coroutine is still running.

Yeah, I just looked through the code, it doesn't look like we're doing wrong thing. Maybe you have a memory corruption in Vinagre that is leading to a bogus reference count in the widget?

Regards,

Anthony Liguori

Dan.





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