Skip to content
This repository has been archived by the owner on Feb 11, 2021. It is now read-only.

Commit

Permalink
Fixed errors detected by valgrind.
Browse files Browse the repository at this point in the history
  • Loading branch information
bobbens committed Aug 4, 2009
1 parent 20be33d commit ee39b7d
Showing 1 changed file with 17 additions and 17 deletions.
34 changes: 17 additions & 17 deletions test/automated/render/render.c
Expand Up @@ -570,15 +570,15 @@ static int render_testBlit (void)
if (SDL_ATassert( "SDL_CreateTextureFromSurface", tface != 0))
return -1;

/* Clean up. */
SDL_FreeSurface( face );

/* Constant values. */
rect.w = face->w;
rect.h = face->h;
ni = SCREEN_W - face->w;
nj = SCREEN_H - face->h;

/* Clean up. */
SDL_FreeSurface( face );

/* Loop blit. */
for (j=0; j <= nj; j+=4) {
for (i=0; i <= ni; i+=4) {
Expand Down Expand Up @@ -631,15 +631,15 @@ static int render_testBlitColour (void)
if (SDL_ATassert( "SDL_CreateTextureFromSurface", tface != 0))
return -1;

/* Clean up. */
SDL_FreeSurface( face );

/* Constant values. */
rect.w = face->w;
rect.h = face->h;
ni = SCREEN_W - face->w;
nj = SCREEN_H - face->h;

/* Clean up. */
SDL_FreeSurface( face );

/* Test blitting with colour mod. */
for (j=0; j <= nj; j+=4) {
for (i=0; i <= ni; i+=4) {
Expand Down Expand Up @@ -698,15 +698,15 @@ static int render_testBlitAlpha (void)
if (SDL_ATassert( "SDL_CreateTextureFromSurface", tface != 0))
return -1;

/* Clean up. */
SDL_FreeSurface( face );

/* Constant values. */
rect.w = face->w;
rect.h = face->h;
ni = SCREEN_W - face->w;
nj = SCREEN_H - face->h;

/* Clean up. */
SDL_FreeSurface( face );

/* Clear surface. */
if (render_clearScreen())
return -1;
Expand Down Expand Up @@ -812,14 +812,6 @@ static int render_testBlitBlend (void)
if (SDL_ATassert( "SDL_CreateTextureFromSurface", tface != 0))
return -1;

/* Clean up. */
SDL_FreeSurface( face );

/* Set alpha mod. */
ret = SDL_SetRenderDrawColor( 255, 255, 255, 100 );
if (SDL_ATassert( "SDL_SetRenderDrawColor", ret == 0))
return -1;

/* Steps to take. */
ni = SCREEN_W - FACE_W;
nj = SCREEN_H - FACE_H;
Expand All @@ -828,6 +820,14 @@ static int render_testBlitBlend (void)
rect.w = face->w;
rect.h = face->h;

/* Clean up. */
SDL_FreeSurface( face );

/* Set alpha mod. */
ret = SDL_SetRenderDrawColor( 255, 255, 255, 100 );
if (SDL_ATassert( "SDL_SetRenderDrawColor", ret == 0))
return -1;

/* Test None. */
if (render_testBlitBlendMode( tface, SDL_BLENDMODE_NONE ))
return -1;
Expand Down

0 comments on commit ee39b7d

Please sign in to comment.