When building CppReact into a dynamic library, the REACTIVE_DOMAIN() macro creates separate instances of the Engine and the InputManager for both the library and the library consumer.
This is because Instance() is defined in a header and declares static variables. However, given the nature of dynamic libraries, this actually creates 2 versions, 1 in the dynamic library's static address space and another in the static address space of application using the dynamic library. You can imagine how this might cause issues for someone using CppReact in a dynamic library.
When building CppReact into a dynamic library, the
REACTIVE_DOMAIN()
macro creates separate instances of theEngine
and theInputManager
for both the library and the library consumer.This is because
Instance()
is defined in a header and declares static variables. However, given the nature of dynamic libraries, this actually creates 2 versions, 1 in the dynamic library's static address space and another in the static address space of application using the dynamic library. You can imagine how this might cause issues for someone using CppReact in a dynamic library.For a discussion, see: http://stackoverflow.com/questions/8623657/multiple-instances-of-singleton-across-shared-libraries-on-linux
(For reference, I'm on mac building with clang)