Hello all,
I’m having difficulty with SDL_FreeSurface(). In a function, I
initalize a surface like:
SDL_Surface *image;
I later then say,
image = (SDL_Surface *)ship->hull->image;
(where the ship structure contains another structure, hull, which
defines image as SDL_Surface *image)
I then create two SDL_Rects, set the x,y,w,h values, use
SDL_BlitSurface() to blit image, however, because this function is
called often, I don’t want to create a memory leak, so I should free up
image, right?
SDL_FreeSurface(image);
and it crashes right there w/ an SDL Parachute. Perhaps I’m getting
something with pointers mixed up? Anybody know what’s wrong and/or
should I provide more code?–
Chris
@Christopher_Thielen