aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHampusM <hampus@hampusmat.com>2022-02-27 17:55:12 +0100
committerHampusM <hampus@hampusmat.com>2022-06-13 17:56:53 +0200
commit4637b2dc86e69b15acf89d643a1534fb9e5ba31e (patch)
treecbf712272e1a501dd27cc4c447b13b7ced10aa59
parentfe79577396231f2edb7927f1f61ce814f03851a7 (diff)
fix: stop segfault caused by game ctor
-rw-r--r--src/game/game.cpp2
-rw-r--r--src/game/game.hpp4
2 files changed, 3 insertions, 3 deletions
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 <chrono>
#include <thread>
-Game::Game(const std::shared_ptr<IScene> &scene) : _scene(scene) {}
+Game::Game(std::shared_ptr<IScene> 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<IGame, Game, IScene>
{
public:
- explicit Game(const std::shared_ptr<IScene> &scene);
+ explicit Game(std::shared_ptr<IScene> scene);
void run() override;
private:
- const std::shared_ptr<IScene> &_scene;
+ std::shared_ptr<IScene> _scene;
};