Re: GTK_DESTROYED not set after gtk_object_destroy() ?



Havoc Pennington <hp redhat com> writes:

> I'd guess that the basic outline of solving this would be that
> deleting the C++ wrapper would free the C++ wrapper, dissociate it
> from the C object, return the C object to a sane and valid state, and
> also call gtk_object_destroy() to encourage other reference-holders to
> let go. That should eliminate segfaults, at least. I remember it being
> more complicated than that, but I don't remember what the issues were.

Well, the main complication here is implemented-in-C++ objects.  As
you point out gtk-- approach of allowing widgets to be "allocated" on
the stack or directly in another object is basically incompatible with
GTK+'s memory management model.

As in GTK+-1.2, you probably can get away with it, most of the time,
with hacks, if nobody does anything unusual, but the hacks may be
bigger than before.

Regards,
                                        Owen

[ I remember extensive discussions with Tero about memory management 
  in the early days of gtk-- ]




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