hedgewars/uTextures.pas
changeset 9655 e154ccca4dad
parent 9080 9b42757d7e71
child 9682 aa2431ed87b2
child 9998 736015b847e3
--- 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;