--- a/pmc/surface.cc +++ b/pmc/surface.cc @@ -25,10 +25,13 @@ color = red; bpp = screen->format->BytesPerPixel; + + refCounter++; } Surface::~Surface () { + SDL_FreeSurface (screen); SDL_Quit (); }