Permalink
Browse files

go back to calloc ...

  • Loading branch information...
Keruspe committed Jul 1, 2010
1 parent 3769f29 commit cd870327e51055e4b52363af8ee0c0766feb5ca2
Showing with 2 additions and 2 deletions.
  1. +2 −2 src/display/display.cpp
View
@@ -135,7 +135,7 @@ Display::svgToSurface(std::string file, Uint32 targetWidth, Uint32 targetHeight)
double sH = static_cast< double >(targetHeight) / static_cast< double >(dims.height);
Uint32 stride = 4 * targetWidth;
void * buffer = new unsigned char[stride * targetHeight];
void * buffer = calloc(stride * targetHeight, 1);
cairo_surface_t * cSurface = cairo_image_surface_create_for_data(
static_cast< unsigned char * >(buffer),
@@ -243,7 +243,7 @@ Display::cleanSurface(SDL_Surface * & surf)
std::map< SDL_Surface *, void * >::iterator i = buffers.find(surf);
if ( i != buffers.end() )
{
delete[] i->second;
free(i->second);
buffers.erase(i);
}
SDL_FreeSurface(surf);

0 comments on commit cd87032

Please sign in to comment.