Re: g_intern_static_string() and modules



On 2/24/06, Federico Mena Quintero <federico ximian com> wrote:
> Hi,
>
> Currently, we explicitly disallow the gtkfilesystemgnomevfs module from
> being unloaded because some dumb part of libgnomeui assumes that it is
> always in memory.  I don't remember the exact problem right now, but
> finding it in the ChangeLog is left as an exercise for the reader.
>
> My question in particular is about g_intern_static_string().  If I'm
> a .so that is sometimes linked in, and sometimes dlopen()ed, how can I
> know whether I should use g_intern_static_string() or g_intern_string()?
> If I'm dlopen()ed, I can't intern a static string because it will cause
> trouble when I'm dlclose()d.
>
> The more general question, of course, is how to know when a library was
> loaded at runtime so that this problem can be avoided.
>

When in doubt, use g_intern_string() (and don't use G_DEFINE_TYPE).



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