static variables used to hold a Singleton cannot be shared across dll boundaries by default. This uses the globalInstance template to store the instance as a property on the QApplication.
Showing the changes to libraries/shared/src/DebugDraw.cpp (1 of 1 file). Show all
Unified · Split
| @@ -8,10 +8,11 @@ · 7 unmodified lines | ||
| 8 | 8 | // |
| 9 | 9 | |
| 10 | 10 | #include "DebugDraw.h" |
| 11 | +#include "SharedUtil.h" | |
| 11 | 12 | |
| 12 | 13 | DebugDraw& DebugDraw::getInstance() { |
| 13 | − static DebugDraw instance; | |
| 14 | − return instance; | |
| 14 | + static DebugDraw* instance = globalInstance<DebugDraw>("com.highfidelity.DebugDraw"); | |
| 15 | + return *instance; | |
| 15 | 16 | } |
| 16 | 17 | |
| 17 | 18 | DebugDraw::DebugDraw() { |