X-Git-Url: http://deadsoftware.ru/gitweb?a=blobdiff_plain;f=src%2Fgame%2Fg_textures.pas;h=87893c2a9cc22089e60ac02798d1bbbdf2e097a2;hb=ada62776e1c2db5a0107b2eed7a3cac72250aa43;hp=9f551f5b830ce6a3aa19d1746256bec631750950;hpb=92c7868df227201d6914f9f07c9a29ba0e2863cb;p=d2df-sdl.git diff --git a/src/game/g_textures.pas b/src/game/g_textures.pas index 9f551f5..87893c2 100644 --- a/src/game/g_textures.pas +++ b/src/game/g_textures.pas @@ -2,8 +2,7 @@ * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. + * the Free Software Foundation, version 3 of the License ONLY. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -222,13 +221,8 @@ begin if WAD.GetResource(g_ExtractFilePathName(Resource), TextureData, ResourceLength) then begin if e_CreateTextureMem(TextureData, ResourceLength, ID) then - begin result := true; - end - else - begin - FreeMem(TextureData); - end; + FreeMem(TextureData) end else begin @@ -273,11 +267,8 @@ begin e_GetTextureSize(texturesArray[find_id].ID, @texturesArray[find_id].width, @texturesArray[find_id].height); texturesArray[find_id].used := true; texturesArray[find_id].Name := textureName; - end - else - begin - FreeMem(TextureData); end; + FreeMem(TextureData) end else begin @@ -542,10 +533,12 @@ begin if not CreateFramesMem(TextureData, ResourceLength, ID, Name, mWidth, mHeight, mCount, BackAnimation) then begin + FreeMem(TextureData); WAD.Free(); exit; end; + FreeMem(TextureData); WAD.Free(); result := true;