Alex Romosan wrote:
Erik Hofman <[EMAIL PROTECTED]> writes:


Unfortunately RTLD_DEFAULT isn't supported on all platforms (it isn't
supported in IRIX anyhow). I think that if what you describe is the
problem this really is a bug at your side. What happens is that the
function pointer is copied to ftpr. So dlcose() should never be able
to have any effects on this copy ??


dlclose() doesn't have the effect on the pointer. it just makes that
pointer point to something non-existent once the handle becomes
invalid, hence the core dump.

Well, that's the part that I don't get.

From the man pages:
"All objects loaded automatically as a result of invoking dlopen on the referenced object are also closed (however no object still open as a result of any dlopen command is closed until dlclose has closed the last open handle."


You see, dlclose keeps a counter of the number of dlopen/dlclose calls and only removes the shared object when dlclose is called as many times as dlopen.

FlightGear links directly to libGL, making the number of dlopen calls one more then the number of dlclose calls.

This really is a bug in your shared library implementation, ot you have mangled your local copy of FlightGear in such a way that it's dlclosing libGL more than necessary.


> what you have there is bad programing
practice. if you do a search for dlclose and dlsym you will see that
nobody uses the pointer returned by dlsym() _after_ a call to
dlclose()

It's not bad programming practice. It's called knowing what you are doing.

Erik


_______________________________________________ Flightgear-devel mailing list [EMAIL PROTECTED] http://mail.flightgear.org/mailman/listinfo/flightgear-devel

Reply via email to