hedgewars/uChat.pas
changeset 4925 3d90fd7f738a
parent 4920 bc3c077e15a2
child 4976 088d40d8aba2
--- a/hedgewars/uChat.pas	Sat Feb 05 22:22:16 2011 +0100
+++ b/hedgewars/uChat.pas	Sun Feb 06 00:47:00 2011 +0100
@@ -65,9 +65,8 @@
     color: TSDL_Color;
     font: THWFont;
 begin
-// these two lines lines crash when run multiple times?
-//if cl.Tex <> nil then
-//    FreeTexture(cl.Tex);
+if cl.Tex <> nil then
+    FreeTexture(cl.Tex);
 
 cl.s:= str;
 
@@ -355,6 +354,7 @@
 end;
 
 procedure initModule;
+var i: ShortInt;
 begin
     RegisterVariable('chatmsg', vtCommand, @chChatMessage, true);
     RegisterVariable('say', vtCommand, @chSay, true);
@@ -367,6 +367,12 @@
     showAll:= false;
     ChatReady:= false;
     missedCount:= 0;
+
+    inputStr.Tex := nil;
+    for i:= 0 to MaxStrIndex do
+    begin
+        Strs[i].Tex := nil;
+    end;
 end;
 
 procedure freeModule;