Indeed, under Linux there would be issues that are dependent on how the
plug-in is compiled and linked. (Others could speak to issues related
to other operating systems.)
For instance, if a plug-in does link against OpenEXR statically but
does not do anything about limiting where it finds global symbols (like
not using -Wl,-Bsymbolic or other related options) then the
plug-in can end up binding to OpenEXR symbols from elsewhere in the
process.
With namespaces, at least we have a mechanism to make sure
that those additional copies of those symbols are related to a
compatible implementation. But it does mean that there can be
additional unrelated code piggy-backing on static data that might
otherwise be controlled by initialization and clean-up that expects
only one call each.
If we were to add clean-up, we would need to have a corresponding count
of the number explicit requests to initialize.
On 11/07/13 10:04, Peter Hillman wrote:
It should work most of the time. I was more concerned about edge cases
causing unpredictable crashes depending on link flags, dlopen flags and
the like, and the implications of introducing the change so that some
versions of OpenEXR uninitialize and others do not.
On 07/11/13 09:48, Christopher Horvath
wrote:
If both plugins are statically linked, they'll each
have their own copy of any global variables, with their own addresses.
Does that fix this, in any way?
|