Re: gtk_object_unref



"Jean-Christophe Berthon" <jean-christophe berthon cgey com> writes: 
> OK. I didn't really understand everything (esp. about the floating
> reference, I don't exactly what this thing mean or is...). But I've tryed to
> add to my code a gtk_object_sink just after the creation of the
> canvas item.

You shouldn't need to sink, just be sure you ref.

> Then I've tryed to add instead gtk_object_ref and gtk_object_sink. 

That should be OK.

> And
> finally I've tryed gtk_object_ref only instead of the previous two
> commands.

Also should be OK.

> But in all this case I got the warnings.

Something else is wrong then.

> But I want to precise one thing.
> The unref operation occur in a callback of the canvas item. So one of them
> receive an action from the user and I have to unref this item and a second
> one (passed with the void* of the callback).
> The item that fired the event has a ref_count of 3 (instead I would expect
> 1)

The signal subsystem will temporarily add references while emitting a
signal on an object, that explains the refcount of 3.

Havoc




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