Fixed a memory leak
authorSergey Alirzaev <zl29ah@gmail.com>
Thu, 12 Jan 2023 22:15:24 +0100
changeset 15972 303cf91e5233
parent 15899 73cdc306888f
child 15973 2d9d07ccb8ef
Fixed a memory leak
hedgewars/uGears.pas
--- a/hedgewars/uGears.pas	Tue Dec 13 21:21:55 2022 +0100
+++ b/hedgewars/uGears.pas	Thu Jan 12 22:15:24 2023 +0100
@@ -288,6 +288,7 @@
                             curHandledGear^.Tex:= RenderStringTex(trmsg[sidUnknownGearValue], $ff808080, fntSmall)
                         else
                             begin
+                            FreeAndNilTexture(curHandledGear^.Tex);
                             // Display mine timer with up to 1 decimal point of precision (rounded down)
                             i:= curHandledGear^.Timer div 1000;
                             j:= (curHandledGear^.Timer mod 1000) div 100;