diff options
author | max-001 <maxsmits21@kpnmail.nl> | 2024-11-24 11:52:48 +0100 |
---|---|---|
committer | max-001 <maxsmits21@kpnmail.nl> | 2024-11-24 11:52:48 +0100 |
commit | 2f10649bf08bbe507458fa4da8be1dd7b02213da (patch) | |
tree | 7ad282d9faa00b719e13e29bc45cc99869d777d0 | |
parent | 5f710fedcbbf43f65e0ef1241f22e06d42cf79b9 (diff) |
Implemented feedback
-rw-r--r-- | src/crepe/api/SceneManager.hpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/crepe/api/SceneManager.hpp b/src/crepe/api/SceneManager.hpp index ccc755f..5c8e417 100644 --- a/src/crepe/api/SceneManager.hpp +++ b/src/crepe/api/SceneManager.hpp @@ -10,10 +10,11 @@ void SceneManager::add_scene(Args &&... args) { static_assert(is_base_of<Scene, T>::value, "T must be derived from Scene"); Scene * scene = new T(std::forward<Args>(args)...); + unique_ptr<Scene> unique_scene(scene); - scene->component_manager = this->component_manager; + unique_scene->component_manager = this->component_manager; - this->scenes.emplace_back(unique_ptr<Scene>(scene)); + this->scenes.emplace_back(std::move(unique_scene)); // The first scene added, is the one that will be loaded at the beginning if (next_scene.empty()) { |