Find the answer to your Linux question:
Results 1 to 2 of 2
Hi All, What happens if I attempt to reload a previously loaded plugin with dlopen() without using dlclose() to close it first ? In such a case, does it give ...
  1. #1
    Just Joined!
    Join Date
    Nov 2009
    Posts
    43

    Question attempting to reload a previously loaded plugin with dlopen()

    Hi All,

    What happens if I attempt to reload a previously loaded plugin with dlopen() without using dlclose() to close it first ?

    In such a case, does it give me another plugin handle for the same plugin module ? (I would have two plugin handles in this case both of which should be closed using dlclose() ?)

    Thanks.

  2. #2
    Linux Guru Rubberman's Avatar
    Join Date
    Apr 2009
    Location
    I can be found either 40 miles west of Chicago, or in a galaxy far, far away.
    Posts
    8,974
    From the dlopen man page:
    If the same library is loaded again with dlopen(), the same file handle is
    returned. The dl library maintains reference counts for library handles, so a
    dynamic library is not deallocated until dlclose() has been called on it as
    many times as dlopen() has succeeded on it. The _init routine, if present, is
    only called once. But a subsequent call with RTLD_NOW may force symbol reso-
    lution for a library earlier loaded with RTLD_LAZY.
    Sometimes, real fast is almost as good as real time.
    Just remember, Semper Gumbi - always be flexible!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
...