From 4637b2dc86e69b15acf89d643a1534fb9e5ba31e Mon Sep 17 00:00:00 2001 From: HampusM Date: Sun, 27 Feb 2022 17:55:12 +0100 Subject: fix: stop segfault caused by game ctor --- src/game/game.cpp | 2 +- src/game/game.hpp | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) (limited to 'src/game') diff --git a/src/game/game.cpp b/src/game/game.cpp index 9b08adc..2c99c6a 100644 --- a/src/game/game.cpp +++ b/src/game/game.cpp @@ -3,7 +3,7 @@ #include #include -Game::Game(const std::shared_ptr &scene) : _scene(scene) {} +Game::Game(std::shared_ptr scene) : _scene(std::move(scene)) {} void Game::run() { diff --git a/src/game/game.hpp b/src/game/game.hpp index 6abb349..e7d91d6 100644 --- a/src/game/game.hpp +++ b/src/game/game.hpp @@ -9,10 +9,10 @@ class Game : public IGame, public AutoWirable { public: - explicit Game(const std::shared_ptr &scene); + explicit Game(std::shared_ptr scene); void run() override; private: - const std::shared_ptr &_scene; + std::shared_ptr _scene; }; -- cgit v1.2.3-18-g5258