# HG changeset patch # User koda # Date 1269204945 0 # Node ID 177b2b273d4a5566408eace52fbc5d0f109640e0 # Parent 3e7f4a30e18abb717db2555ea5735f760b8b6eb5 fix a small leak diff -r 3e7f4a30e18a -r 177b2b273d4a hedgewars/uStore.pas --- a/hedgewars/uStore.pas Sun Mar 21 20:54:18 2010 +0000 +++ b/hedgewars/uStore.pas Sun Mar 21 20:55:45 2010 +0000 @@ -217,7 +217,7 @@ r.h:= 19; DrawRoundRect(@r, cWhiteColor, cNearBlackColor, texsurf, true); - + // overwrite flag for cpu teams and keep players from using it if (Hedgehogs[0].Gear <> nil) and (Hedgehogs[0].BotLevel > 0) then Flag:= 'cpu' @@ -238,7 +238,9 @@ PLongwordArray(texsurf^.pixels)^[32 * 16 + 23]:= cNearBlackColor; FlagTex:= Surface2Tex(texsurf, false); - + SDL_FreeSurface(texsurf); + texsurf:= nil; + dec(drY, r.h + 2); DrawHealthY:= drY; for i:= 0 to 7 do @@ -248,11 +250,10 @@ NameTagTex:= RenderStringTex(Name, Clan^.Color, CheckCJKFont(Name,fnt16)); if Hat <> 'NoHat' then begin - texsurf:= nil; if (Length(Hat) > 39) and (Copy(Hat,1,8) = 'Reserved') and (Copy(Hat,9,32) = PlayerHash) then - texsurf:= LoadImage(Pathz[ptHats] + '/Reserved/' + Copy(Hat,9,Length(s)-8), ifNone) + texsurf:= LoadImage(Pathz[ptHats] + '/Reserved/' + Copy(Hat,9,Length(s)-8), ifNone) else - texsurf:= LoadImage(Pathz[ptHats] + '/' + Hat, ifNone); + texsurf:= LoadImage(Pathz[ptHats] + '/' + Hat, ifNone); if texsurf <> nil then begin HatTex:= Surface2Tex(texsurf, true);