Feature request: implement unloading of gobject (and gmodule)?
Hello folks,
I'd like to request that it be possible to unload and reload libgobject. I'm not sure that I have a similar interest in unloading and reloading libgmodule, but I may as well cover it in the same ticket.
I'm sorry to rehash what looks to be an old issue, but looking over various past issues I don't seem to get a clear impression on whether unloading is ever intended to be implemented in these modules, or whether it's to be considered forever WONTFIX. I'd find it a bit unfortunate, albeit understandable, if the latter is the case.
The particular reason I care is that I tried to unload and reload libgstreamer and ran into some crashes. libgobject is marked nodelete, but libgstreamer isn't, so when libgstreamer was reloaded it tried to register static types again and things immediately broke. Of course this is a good example of why the problem is difficult—libgstreamer would presumably need a way to explicitly unregister its static types on exit, and that does not yet exist as far as I can see (and is not trivial to implement either).
Still, it can be done, and seems at least plausibly worth doing. The alternative seems to me to manually go to libgstreamer, and any other library that tries to register static types, and mark them all as nodelete—and then that will likely cascade even further. (How many of these libraries can we even find? How many are maintained?) That seems more than a little unfortunate. Of course, it may be necessary to do in the meantime anyway, but if it's nothing more than a workaround, that justifies applying it on an as-needed basis.