Skip to content
Snippets Groups Projects
Commit 217a00a5 authored by Studer Gabriel's avatar Studer Gabriel
Browse files

nicely unregister GLCanvas from scene when destructor is called

parent c4e2fa33
No related branches found
No related tags found
No related merge requests found
...@@ -41,6 +41,10 @@ ost::gui::GLCanvas::GLCanvas(): QOpenGLWindow(), ...@@ -41,6 +41,10 @@ ost::gui::GLCanvas::GLCanvas(): QOpenGLWindow(),
gfx::Scene::Instance().Register(this); gfx::Scene::Instance().Register(this);
} }
ost::gui::GLCanvas::~GLCanvas() {
gfx::Scene::Instance().Unregister(this);
}
void GLCanvas::StatusMessage(const String& m) { void GLCanvas::StatusMessage(const String& m) {
// This Window can also be displayed without a full blown GostyApp. // This Window can also be displayed without a full blown GostyApp.
// We therefore only feed the message into Gosty if there's already // We therefore only feed the message into Gosty if there's already
......
...@@ -37,6 +37,7 @@ class GLCanvas : public QOpenGLWindow, public gfx::GLWinBase { ...@@ -37,6 +37,7 @@ class GLCanvas : public QOpenGLWindow, public gfx::GLWinBase {
public: public:
GLCanvas(); GLCanvas();
virtual ~GLCanvas();
// gfx::GLWinBase interface // gfx::GLWinBase interface
virtual void MakeActive() { this->makeCurrent(); } virtual void MakeActive() { this->makeCurrent(); }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment