Re: destroying GTypeModule object?



On Sat, May 27, 2006 at 04:58:22PM -0400, Philip Kovacs wrote:
Is it ever safe to destroy a GTypeModule object after it is created and 
load() runs
(to initialize/register the plugin types?).  The g_type_module_unuse() 
documentation
states:

"Once a GTypeModule 
<http://developer.gnome.org/doc/API/2.0/gobject/GTypeModule.html> is 
initialized, it must exist forever."

What I am doing is keeping a GList of these objects.   I would like to 
free them
and the containing list in my exit() code because it's an obvious leak.

Why it is a leak not to free memory at exit() immediately
before the operating system will do it anyway -- and more
efficiently?  In my opinion to free it piece by piece is
a waste of resources.

Moreover, a memory leak occurs when something that can and
should be freed is not freed.  When something cannot cease
to exist by design (GTypes are registered once for all) it
is not a leak.  Deregistration of types -- which is
a prerequisite for what you want -- would break the
assertion that once you got a GType you can instantiate
objects of this type.

Yeti


--
Anonyms eat their boogers.



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