More crash fix attempts...

This commit is contained in:
Rob Pearce 2008-10-27 05:54:21 +00:00
parent 93f05fd5c7
commit d3643b85ba
1 changed files with 5 additions and 1 deletions

6
rc.c
View File

@ -5755,7 +5755,10 @@ SDL_Surface *grabbehind(sprite_t *s, SDL_Surface *surf) {
SDL_Rect area; SDL_Rect area;
// create buffer for player background // create buffer for player background
if (surf) SDL_FreeSurface(surf); if (surf) {
SDL_FreeSurface(surf);
surf = NULL;
}
surf = SDL_CreateRGBSurface(SDL_SWSURFACE, surf = SDL_CreateRGBSurface(SDL_SWSURFACE,
s->img->w, s->img->h, s->img->w, s->img->h,
screen->format->BitsPerPixel, screen->format->Rmask, screen->format->BitsPerPixel, screen->format->Rmask,
@ -8559,6 +8562,7 @@ void keeponscreen(sprite_t *s) {
void stopteleporting(sprite_t *s) { void stopteleporting(sprite_t *s) {
if (s->allocimg) { if (s->allocimg) {
SDL_FreeSurface(s->img); SDL_FreeSurface(s->img);
s->img = NULL;
} }
s->allocimg = B_FALSE; s->allocimg = B_FALSE;
s->teleporting = 0; s->teleporting = 0;