Home > Back-end >  IdUDPServer thread to send data in MemProof hint memory leaks
IdUDPServer thread to send data in MemProof hint memory leaks

Time:09-29


I had a small test procedures, While loop within the thread sends a command to the IdUDPServer sending interval of 1 s, each cycle will be on the interface label1. Caption display cycles, run 100000 times
When running more than 17000 MemProof prompt code has 18 leak positioning is the first line LStrClr (pictured)
My code is as follows:
Procedure TTestThreadUDPSend. Execute;
Var
I: Integer;
FComCtrl: TIdUDPServer;//communication control
The begin
FComCtrl:=TIdUDPServer. Create (nil);
If FComCtrl. Active then FComCtrl. Active:=False;
FComCtrl. DefaultPort:=4004;
If not FComCtrl. Active then FComCtrl. Active:=True;
While I & lt; 100000 do begin
Inc (I);
FI:=I;
The Synchronize (shwI);
FComCtrl. Send (' 192.168.0.34 ', 4004, '130300 c8000d0683');

Sleep (1000);
end;
FComCtrl. Free;
end;

Procedure TTestThreadUDPSend. ShwI;
The begin
Form1. Label1. Caption:=';
Form1. Label1. Caption:=IntToStr (FI).
end;

Procedure TForm1. Button3Click (Sender: TObject);
The begin
TestThreadUDPSend:=TTestThreadUDPSend. Create (true);
TestThreadUDPSend. FreeOnTerminate:=True;
TestThreadUDPSend. Resume;
end;

Hope the great god directions, is LStrClr string leaked? A great god, please show where is the problem?

CodePudding user response:

CSDN why nobody reply? The posts are drowned

CodePudding user response:

Can't let post sink ah, we used MemProof please answer,
I see you have several tips on the graph, the prompt you said but there is no difference with other,
Compile environment itself has a leak is possible, I look at your code is no problem

CodePudding user response:


Great god?

CodePudding user response:


My post
  • Related