Erik Hofman wrote:
> Andy Ross wrote:
> > Seriously: consider the case where this symbol came out of a library
> > that we *don't* link to statically.
>
> Why would I?
>
> > Then this would undeniably be a
> > bug, because the library would be unmapped before the function could
> > be called.  Honestly, this code is just wrong.
>
> No it's not. I can't see a case where a program that relies so
> heavily on OpenGL wouldn't link to the GL library at link time.

Let's turn this around: what do you *want* the dlclose() invocation to
do for you?  Its documented behavior is to close and invalidate the
shared library mapping if it is currently unused.  Since you are
caching and returning a pointer to a function in the library, this
cannot possibly be what you want.  Why is the line there if we all
agree it is a no-op?  Occam's razor demands that you take it out.

Andy


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

Reply via email to