From d1abfc313eb3d6508a35cbef458739b4d7c3f857 Mon Sep 17 00:00:00 2001 From: jacob1 Date: Sun, 6 Jan 2013 18:26:38 -0500 Subject: fix mismatched free()/delete's diff --git a/src/client/GameSave.cpp b/src/client/GameSave.cpp index 7103113..8d8a95c 100644 --- a/src/client/GameSave.cpp +++ b/src/client/GameSave.cpp @@ -286,7 +286,7 @@ std::vector GameSave::Serialise() int dataSize; char * data = Serialise(dataSize); std::vector dataVect(data, data+dataSize); - delete data; + free(data); return dataVect; } diff --git a/src/graphics/Graphics.cpp b/src/graphics/Graphics.cpp index 974a169..54544d3 100644 --- a/src/graphics/Graphics.cpp +++ b/src/graphics/Graphics.cpp @@ -317,8 +317,8 @@ pixel *Graphics::resample_img(pixel *src, int sw, int sh, int rw, int rh) samples[i] = new float[sourceWidth]; } - unsigned char * resultImage = new unsigned char[resultHeight * resultPitch]; - std::fill(resultImage, resultImage + (resultHeight*resultPitch), 0); + unsigned char * resultImage = (unsigned char*)malloc((resultHeight * resultPitch) * sizeof(unsigned char)); + memset(resultImage, 0, (resultHeight * resultPitch) * sizeof(unsigned char)); //Resample time int resultY = 0; -- cgit v0.9.2-21-gd62e