From 2f10649bf08bbe507458fa4da8be1dd7b02213da Mon Sep 17 00:00:00 2001 From: max-001 Date: Sun, 24 Nov 2024 11:52:48 +0100 Subject: Implemented feedback --- src/crepe/api/SceneManager.hpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src/crepe') 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::value, "T must be derived from Scene"); Scene * scene = new T(std::forward(args)...); + unique_ptr unique_scene(scene); - scene->component_manager = this->component_manager; + unique_scene->component_manager = this->component_manager; - this->scenes.emplace_back(unique_ptr(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()) { -- cgit v1.2.3