Weird memory leak in URIParser.Parse. lazarus / 21-General ---------------------------------------------------------------------- asmx · 2023-12-30 09:33 Hello every one~ I am a beginner in fpc . Please see attachment, why line 69 has memory leak. :'( ---------------------------------------------------------------------- marcov · 2023-12-30 11:52 Quote from: asmx on December 30, 2023, 10:33:50 amHello every one~ I am a beginner in fpc . Please see attachment, why line 69 has memory leak. :'( My guess is that the strings that are created in that line are still referenced by loopthread. In other words: I think is probably the not correctly .waitfor and freeing of loopthread. Keep in mind that the heaptrace only gives the place where it was allocated, not necessarily the place that causes the memleak ---------------------------------------------------------------------- asmx · 2023-12-30 14:56 Thanks for the reply. The memory leak prompt of fpc sometimes makes me feel strange. After modifying some codes, the leak no longer exists. ---------------------------------------------------------------------- marcov · 2023-12-30 20:16 It might be that you added/changed something that shut down slightly slower so that the thread had enough time to finish. It would be better to really solve it. How do you terminate that thread? ---------------------------------------------------------------------- asmx · 2023-12-31 17:05 Just Terminate thread and then halt pargram. ---------------------------------------------------------------------- marcov · 2023-12-31 19:04 The standard order is Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i loopthread.terminate; // tell thread to terminateloopthread.waitfor; // wait in main thread till the thread has finished.loopthread.free; // deallocate the thread. ---------------------------------------------------------------------- asmx · 2024-01-01 01:54 Thank you for your reply.