Re: gtk-2 bug, inconsistency or simply misunderstanding on my side ?



(resent 'cuz original message was sent from the wrong mailbox 
- Sorry, list moderators....)
--
Hi Owen, Olexiy,

Here comes my example. It's based on gtkdial.

Get the source from http://www.xfce.org/archive/gtkdial.bug.tar.gz

Untar, compile with "make" and run it.

When you click on the button, you get the following message :

** Message: freeing dial widget (80724f8)
** Message: freeing dial widget (80724f8)

(dial_test:5926): Gtk-WARNING **: A floating object was finalized. This
means that someone
called g_object_unref() on an object that had only a floating
reference; the initial floating reference is not owned by anyone
and must be removed with gtk_object_sink() after a normal
reference is obtained with g_object_ref().


The trace (g_message) is located right in gtk_dial_destroy(). It shows
that the method is called twice on the same object (80724f8)

PS: The frame widget is destroyed with "gtk_widget_destroy()"

Hope that helps,

Best regards,
Olivier.

On Fri, 2002-09-27 at 09:57, Olivier Fourdan wrote:
Hi Owen,

How are you removing it? What do you mean by "freed twice"?
Can you provide a small test case?

The container is removed with gtk_widget_destroy. By "freed twice", I
mean that the widget destroy routine "mywidget_destroy(GtkObject
*object)" is called twice, usually leading to a core dump.

The gtkdial widget, given as example in gtk+-2.0.x source tree should be
enough to see the problem, by adding a simple trace to
gtk_dial_destroy() every time it's called.

Two signal emissions of ::destroy is legitimate and will happen
under some circumstances, but is usually not visible to apps
because signals handler are removed when ::destroy is 
emitted.

I'll try to make a simple test case that shows this behaviour. As I
said, I might just be misunderstanding something, so I don't pretend
that anything is not legitimate in gtk :)

Best regards,
-- 
Olivier               <fourdan xfce org>            http://www.xfce.org





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