From: Dennis S. <sy...@yo...> - 2004-10-20 14:51:23
|
On Wed, 2004-10-20 at 09:07 +0300, Vitaly V. Bursov wrote: > On Tue, 19 Oct 2004 21:57:06 +0200 > Dennis Smit <sy...@yo...> wrote: > > > Well, I don't have a crash related to this... I can load 2 plugins and > > unload them both, my dlopen gives a fake handle for the second library, > > and REALLY closes the library when all handles are being dlclosed... > Hm, it should. Sorry. > ...weird. > The following test program: #include <libvisual/libvisual.h> int main (int argc, char **argv) { VisPluginRef *ref1; VisPluginData *plug1; VisPluginData *plug2; visual_init (&argc, &argv); ref1 = visual_plugin_find (visual_plugin_get_registry (), "oinksie"); printf ("%p\n", ref1); plug1 = visual_plugin_load (ref1); plug2 = visual_plugin_load (ref1); printf ("plug: %p\n", plug1); visual_plugin_realize (plug1); visual_plugin_realize (plug2); visual_plugin_unload (plug1); visual_plugin_unload (plug2); return 0; } Works perfectly, what dlopen seems to do here, is when a library gets opened twice, generate one fake handle. and close the library for real if the last handle is being dlclosed(). Can you show me your code that does not work, or make it possible for me to test. If it seems that dlopen is indeed different on different systems, I can introduce an easy hack into the plugin loader that keeps track on the real handle. But I really think this is NOT needed... Cheers, Dennis |