Switched to chared pointers and macros

This commit is contained in:
Atlante45 2014-12-16 13:54:52 -08:00
parent cf6aa563ac
commit e8a22f6f0f
5 changed files with 10 additions and 8 deletions

View file

@ -194,7 +194,7 @@ Application::Application(int& argc, char** argv, QElapsedTimer &startup_time) :
_isVSyncOn(true),
_aboutToQuit(false)
{
QSharedPointer<GLCanvas> glCanvas = DependencyManager::get<GLCanvas>();
GLCanvas::SharedPointer glCanvas = DependencyManager::get<GLCanvas>();
// read the ApplicationInfo.ini file for Name/Version/Domain information
QSettings applicationInfo(Application::resourcesPath() + "info/ApplicationInfo.ini", QSettings::IniFormat);
@ -442,7 +442,6 @@ void Application::aboutToQuit() {
}
Application::~Application() {
DependencyManager::get<GLCanvas>()->setParent(NULL);
_entities.getTree()->setSimulation(NULL);
qInstallMessageHandler(NULL);

View file

@ -18,8 +18,10 @@
#include <DependencyManager.h>
/// customized canvas that simply forwards requests/events to the singleton application
class GLCanvas : public QGLWidget, public DependencyManager::Dependency {
class GLCanvas : public QGLWidget {
Q_OBJECT
SINGLETON_DEPENDENCY(GLCanvas)
public:
bool isThrottleRendering() const;
@ -60,8 +62,9 @@ private slots:
private:
GLCanvas();
~GLCanvas();
friend class DependencyManager;
~GLCanvas() {
qDebug() << "Deleting GLCanvas";
}
};
#endif // hifi_GLCanvas_h

View file

@ -20,7 +20,7 @@
class DdeFaceTracker : public FaceTracker {
Q_OBJECT
SINGLETON_DEPENDENCY
SINGLETON_DEPENDENCY(DdeFaceTracker)
public:
//initialization

View file

@ -26,7 +26,7 @@
/// Handles interaction with the Faceshift software, which provides head position/orientation and facial features.
class Faceshift : public FaceTracker {
Q_OBJECT
SINGLETON_DEPENDENCY
SINGLETON_DEPENDENCY(Faceshift)
public:
void init();

View file

@ -28,7 +28,7 @@ namespace VisageSDK {
/// Handles input from the Visage webcam feature tracking software.
class Visage : public FaceTracker {
Q_OBJECT
SINGLETON_DEPENDENCY
SINGLETON_DEPENDENCY(Visage)
public:
void init();