fix memory leak when saving stamps
This commit is contained in:
parent
6731fa16b7
commit
9211fab9f7
@ -584,6 +584,7 @@ std::string GameController::StampRegion(ui::Point point1, ui::Point point2, bool
|
|||||||
{
|
{
|
||||||
newSave->paused = gameModel->GetPaused();
|
newSave->paused = gameModel->GetPaused();
|
||||||
std::string stampName = Client::Ref().AddStamp(newSave);
|
std::string stampName = Client::Ref().AddStamp(newSave);
|
||||||
|
delete newSave;
|
||||||
if (stampName.length() == 0)
|
if (stampName.length() == 0)
|
||||||
new ErrorMessage("Could not create stamp", "Error serializing save file");
|
new ErrorMessage("Could not create stamp", "Error serializing save file");
|
||||||
return stampName;
|
return stampName;
|
||||||
|
Reference in New Issue
Block a user