From 076925f61c4285e7ee7294e4c6756cedf6f2c09f Mon Sep 17 00:00:00 2001 From: Bogdan Velicu Date: Thu, 26 Oct 2023 13:38:31 +0300 Subject: [PATCH] cppcheck #2 --- doodle_jump/platform/PlatformGenerator.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/doodle_jump/platform/PlatformGenerator.cpp b/doodle_jump/platform/PlatformGenerator.cpp index 2a081cd..b80b740 100644 --- a/doodle_jump/platform/PlatformGenerator.cpp +++ b/doodle_jump/platform/PlatformGenerator.cpp @@ -21,7 +21,8 @@ PlatformGenerator& PlatformGenerator::operator=(const PlatformGenerator& platfor PlatformGenerator::PlatformGenerator(const PlatformGenerator& platformGenerator_) { std::cout << "PlatformGenerator copy constructor called\n"; - lastPlatform = platformGenerator_.lastPlatform; + lastPlatform = new Platform(); + *lastPlatform = *platformGenerator_.lastPlatform; } // Platform PlatformGenerator::getLastPlatform() {