mirror of
https://github.com/HifiExperiments/overte.git
synced 2025-08-04 00:04:43 +02:00
Merge branch 'master' of https://github.com/highfidelity/hifi
This commit is contained in:
commit
cd2ce2ee2f
1 changed files with 9 additions and 2 deletions
|
@ -17,18 +17,25 @@
|
|||
#include <QSharedPointer>
|
||||
#include <QWeakPointer>
|
||||
|
||||
#include <functional>
|
||||
#include <typeinfo>
|
||||
|
||||
#define SINGLETON_DEPENDENCY \
|
||||
friend class DependencyManager;
|
||||
|
||||
class Dependency {
|
||||
public:
|
||||
typedef std::function<void(Dependency* pointer)> DeleterFunction;
|
||||
|
||||
protected:
|
||||
virtual ~Dependency() {}
|
||||
virtual void customDeleter() {
|
||||
delete this;
|
||||
_customDeleter(this);
|
||||
}
|
||||
|
||||
|
||||
void setCustomDeleter(DeleterFunction customDeleter) { _customDeleter = customDeleter; }
|
||||
DeleterFunction _customDeleter = [](Dependency* pointer) { delete pointer; };
|
||||
|
||||
friend class DependencyManager;
|
||||
};
|
||||
|
||||
|
|
Loading…
Reference in a new issue