Commit graph

28 commits

Author SHA1 Message Date
Anthony Thibault
b46378e0b6 Compile error fix 2019-05-10 15:51:42 -07:00
Anthony Thibault
fe17550a80 Code review feedback
In DependencyManager::set<>() destroy the clear the previous before allocating the new instance.
2019-05-10 15:41:52 -07:00
Anthony Thibault
442a679108 Make DepenencyManager thread-safe again
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).
2019-05-10 14:12:10 -07:00
Seth Alves
fac27553d7 suppress 'No instance available' messages during shutdown. try a different way of shutting down AudioClient. 2018-11-27 17:02:48 -08:00
Seth Alves
8f21ade0c7 make cmake -DDISABLE_QML=1 work again 2018-11-27 12:41:40 -08:00
SamGondelman
d2699e8e5b some more attempted cleanup 2018-07-10 10:50:01 -07:00
SamGondelman
7954865141 trying to fix dependency shutdown 2018-07-05 14:34:37 -07:00
Bradley Austin Davis
b93e91b9f3 New android toolchain 2017-09-19 13:45:12 -07:00
Stephen Birarda
c7a28a527a cleanup Agent recording handling, make loadRecording async 2017-04-04 10:56:25 -07:00
Zach Pomerantz
37efeb7f29 Avoid warning for expected unset PresentThread 2016-04-05 14:59:59 -07:00
Brad Davis
11733c039f Allow shared libraries to access core global objects 2015-11-06 16:57:31 -08:00
Brad Davis
57be59935d Move controller test to app 2015-10-17 19:13:38 -07:00
Atlante45
eb5206f8e6 Naming 2015-03-12 19:05:06 +01:00
Atlante45
0bd97ce40c Dependency::customDeleter uses a lambda 2015-03-12 18:53:29 +01:00
Atlante45
786c0a5462 Drop DM ref before creating new object 2015-01-15 14:00:45 -08:00
Atlante45
27cc3d297e DependencyManager update
- 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
2015-01-13 20:27:38 -08:00
Atlante45
2a82ff9768 Merge branch 'master' of https://github.com/highfidelity/hifi into applications_diet_cpp11
Conflicts:
	assignment-client/src/voxels/VoxelServer.cpp
	interface/src/Application.cpp
	interface/src/Audio.cpp
	interface/src/DatagramProcessor.cpp
	interface/src/Menu.cpp
	interface/src/Util.cpp
	interface/src/avatar/MyAvatar.cpp
	interface/src/ui/ApplicationOverlay.cpp
	interface/src/ui/PreferencesDialog.cpp
	libraries/networking/src/NodeList.cpp
	libraries/shared/src/DependencyManager.h
2015-01-13 11:03:14 -08:00
Atlante45
6d67b8e20c Don't call delete later unless you have to 2015-01-09 15:32:08 -08:00
Atlante45
f2847cec06 Changed Singleton Dependency macro and tweaked DM 2014-12-18 15:42:03 -08:00
Atlante45
aa0998dc7d Moved LimitedNodeList into DM 2014-12-18 10:32:34 -08:00
Atlante45
d9d0166bc9 Use variadic templates to create instance with arguments 2014-12-17 15:23:39 -08:00
Atlante45
6304a5e819 Unused removed method 2014-12-16 16:50:15 -08:00
Atlante45
3f2b5aeca4 Cleaner destruction handling 2014-12-16 16:22:59 -08:00
Atlante45
b2dac6f53f DM users update 2014-12-16 15:32:11 -08:00
Atlante45
cf6aa563ac DM returns shared pointer 2014-12-16 13:54:24 -08:00
Atlante45
e40961df12 Checking that T is in fact derived from Dependency 2014-12-14 21:34:27 -08:00
Atlante45
50fd52377f Couple improvements to the dependency manager 2014-12-12 21:10:45 -08:00
Atlante45
14cda00ebc First implementation of the DependencyManager 2014-12-12 20:52:41 -08:00