--- a/hedgewars/uTextures.pas Tue Oct 29 23:08:10 2013 +0400
+++ b/hedgewars/uTextures.pas Tue Oct 29 23:47:57 2013 +0400
@@ -26,6 +26,7 @@
procedure Surface2GrayScale(surf: PSDL_Surface);
function Surface2Tex(surf: PSDL_Surface; enableClamp: boolean): PTexture;
procedure FreeTexture(tex: PTexture);
+procedure FreeAndNilTexture(var tex: PTexture);
procedure initModule;
procedure freeModule;
@@ -226,6 +227,12 @@
end
end;
+procedure FreeAndNilTexture(var tex: PTexture);
+begin
+ FreeTexture(tex);
+ tex:= nil
+end;
+
procedure initModule;
begin
TextureList:= nil;