diff options
-rw-r--r-- | kurator/src/Session.cpp | 3 | ||||
-rw-r--r-- | kurator/src/Session.h | 1 |
2 files changed, 4 insertions, 0 deletions
diff --git a/kurator/src/Session.cpp b/kurator/src/Session.cpp index 0d55eb3..1d1d513 100644 --- a/kurator/src/Session.cpp +++ b/kurator/src/Session.cpp @@ -15,6 +15,7 @@ namespace kurator void Session::set(std::shared_ptr<Scene> _scene) { + previous_scene = scene; scene = _scene; } @@ -31,6 +32,8 @@ Session::run() scene->draw(); rlImGuiEnd(); EndDrawing(); + if (previous_scene) + previous_scene.reset(); } } diff --git a/kurator/src/Session.h b/kurator/src/Session.h index 4bb55cf..59aa597 100644 --- a/kurator/src/Session.h +++ b/kurator/src/Session.h @@ -20,6 +20,7 @@ private: bool keep_going = true; Window window; std::shared_ptr<Scene> scene; + std::shared_ptr<Scene> previous_scene; }; |