mirror of
https://github.com/overte-org/overte.git
synced 2025-08-08 18:56:55 +02:00
Merge branch 'master' of github.com:highfidelity/hifi into persist-entities-as-json
This commit is contained in:
commit
b945ce5e7a
2 changed files with 12 additions and 2 deletions
|
@ -1818,6 +1818,9 @@ void Application::initDisplay() {
|
||||||
}
|
}
|
||||||
|
|
||||||
void Application::init() {
|
void Application::init() {
|
||||||
|
// Make sure Login state is up to date
|
||||||
|
DependencyManager::get<DialogsManager>()->toggleLoginDialog();
|
||||||
|
|
||||||
_environment.init();
|
_environment.init();
|
||||||
|
|
||||||
DependencyManager::get<DeferredLightingEffect>()->init(this);
|
DependencyManager::get<DeferredLightingEffect>()->init(this);
|
||||||
|
|
|
@ -17,18 +17,25 @@
|
||||||
#include <QSharedPointer>
|
#include <QSharedPointer>
|
||||||
#include <QWeakPointer>
|
#include <QWeakPointer>
|
||||||
|
|
||||||
|
#include <functional>
|
||||||
#include <typeinfo>
|
#include <typeinfo>
|
||||||
|
|
||||||
#define SINGLETON_DEPENDENCY \
|
#define SINGLETON_DEPENDENCY \
|
||||||
friend class DependencyManager;
|
friend class DependencyManager;
|
||||||
|
|
||||||
class Dependency {
|
class Dependency {
|
||||||
|
public:
|
||||||
|
typedef std::function<void(Dependency* pointer)> DeleterFunction;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
virtual ~Dependency() {}
|
virtual ~Dependency() {}
|
||||||
virtual void customDeleter() {
|
virtual void customDeleter() {
|
||||||
delete this;
|
_customDeleter(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void setCustomDeleter(DeleterFunction customDeleter) { _customDeleter = customDeleter; }
|
||||||
|
DeleterFunction _customDeleter = [](Dependency* pointer) { delete pointer; };
|
||||||
|
|
||||||
friend class DependencyManager;
|
friend class DependencyManager;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue