hedgewars/uVisualGears.pas
changeset 3513 f589230fa21b
parent 3475 95345f98da19
child 3592 0bcad5c38c9e
--- a/hedgewars/uVisualGears.pas	Thu Jun 17 11:42:23 2010 -0400
+++ b/hedgewars/uVisualGears.pas	Thu Jun 17 19:57:51 2010 +0200
@@ -327,14 +327,15 @@
 
 procedure DeleteVisualGear(Gear: PVisualGear);
 begin
-if Gear^.Tex <> nil then
-    FreeTexture(Gear^.Tex);
+    if Gear^.Tex <> nil then
+        FreeTexture(Gear^.Tex);
+    Gear^.Tex:= nil;
 
-if Gear^.NextGear <> nil then Gear^.NextGear^.PrevGear:= Gear^.PrevGear;
-if Gear^.PrevGear <> nil then Gear^.PrevGear^.NextGear:= Gear^.NextGear
-   else VisualGearsList:= Gear^.NextGear;
+    if Gear^.NextGear <> nil then Gear^.NextGear^.PrevGear:= Gear^.PrevGear;
+    if Gear^.PrevGear <> nil then Gear^.PrevGear^.NextGear:= Gear^.NextGear
+    else VisualGearsList:= Gear^.NextGear;
 
-Dispose(Gear)
+    Dispose(Gear);
 end;
 
 procedure ProcessVisualGears(Steps: Longword);