aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormax-001 <maxsmits21@kpnmail.nl>2024-11-24 11:52:48 +0100
committermax-001 <maxsmits21@kpnmail.nl>2024-11-24 11:52:48 +0100
commit2f10649bf08bbe507458fa4da8be1dd7b02213da (patch)
tree7ad282d9faa00b719e13e29bc45cc99869d777d0
parent5f710fedcbbf43f65e0ef1241f22e06d42cf79b9 (diff)
Implemented feedback
-rw-r--r--src/crepe/api/SceneManager.hpp5
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()) {