From: Dmitry D. Chernov Date: Thu, 7 Sep 2023 19:35:27 +0000 (+1000) Subject: Fix a memory leak when selecting objects with a mouse-stretchable rectangle X-Git-Url: https://deadsoftware.ru/gitweb?p=d2df-editor.git;a=commitdiff_plain;h=92dde387852a9724b2d8e9d189ed31023a697d8d Fix a memory leak when selecting objects with a mouse-stretchable rectangle --- diff --git a/src/editor/f_main.pas b/src/editor/f_main.pas index 4d62e2e..58b6210 100644 --- a/src/editor/f_main.pas +++ b/src/editor/f_main.pas @@ -3759,7 +3759,12 @@ begin if Button = mbMiddle then MouseMDown := False; - DrawRect := nil; + if DrawRect <> nil then + begin + Dispose(DrawRect); + DrawRect := nil; + end; + ResizeType := RESIZETYPE_NONE; TextureID := 0; @@ -4324,8 +4329,11 @@ begin end; // Клавиши мыши не зажаты: - if (not MouseRDown) and (not MouseLDown) then + if (not MouseRDown) and (not MouseLDown) and (DrawRect <> nil) then + begin + Dispose(DrawRect); DrawRect := nil; + end; // Строка состояния - координаты мыши: StatusBar.Panels[1].Text := Format('(%d:%d)',