Before this PR, there were no locks around the two internal QHash data structures.
Races are rare, due to the fact that the DependencyManager is initialized on the main thread on startup and the fact that a static QWeakPointer was used as an internal cache.
However, there have been reported crashes where the render thread uses DependencyManager::isSet() perhaps while the main thread is adding a late dependency.
DependencyManager::isSet() did not use the static QWeakPointer cache and was more prone to race conditions.
To avoid this and perhaps other data races, mutexes now guard both of the internal QHash data structures.
Also, as an optimization, the most frequent call to DependencyManager::isSet was removed (Profile.cpp).
- Now need a call to DependencyManager::set(...) that support
variable arguments number and type
- Now support destroy operation via DependencyManager::destroy()
- Now support inheritance. All inheritance relationship need to
be specified via DependencyManager::registerInheritance<Base,
Derived>() before any call to the DepedencyManager involving Base.
- Dependencies should now inherit from the class Dependency as
well as using SINGLETON_DEPENDENCY