OSDN Git Service
Fix doubly call of dlclose() in dlobj caching code
When multiple dlobj_cache items point to the same dlobj, dlclose() may
be called wrongly multiple times when these items are cleared, because
we manage the dlobj_cache list as a flat list. This results in a bad
segfault we've seen in openal-soft, for example.
For fixing this, we need the refcounting of dlobj itself. But, in
this case, we don't have to manage yet another list, since dlopen()
does a proper refcounting by itself. That is, we can just call always
dlopen() at each time a new function is assigned, and also call
dlclose() for each released dlobj_cache item at cleanup.
Bugzilla: https://bugzilla.novell.com/show_bug.cgi?id=814250
Signed-off-by: Takashi Iwai <tiwai@suse.de>