MadExcept reports an unreleased thread- handle for every call of this snippet.
It looks like something is not released properly.
I have tried to debug this and it looks like the s7- object itself is released properly.
Can someone help?
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hi,
I program in Delphi but I don't use MadExcept.
With FastMM no issues are reported but maybe it works on different level.
Can I make the same tests also with the personal (non commercial) edition ?
Can you send me a very small complete program (XE5) that I can test showing also the setting that are you using for MadExcept ? You can use davenardella at live dot it.
The client thread is always destroyed into the object destructor.
Regards
Davide
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hi,
thanks for the quick response.
I have generated a test project with just a button on it.
Only code is:
procedure TFrmSnap7Test.btn1Click(Sender: TObject);
var s7Client: TS7Client;
begin
s7Client:=TS7Client.Create;
try
Sleep(200)
finally
s7Client.Free
end;
end;
I have removed MadExcept and other stuff.
When you watch the application with the process explorer (Sysinternals) you can see the handles growing with each click...
Hi,
I'm trying to establish a connection t a PLC using Delphi XE5 and the wrappers,
Function of Snap7 works fine so far.
My problem:
Snap7 generates memory- leaks when creating the object.
My Code (Snippet):
MadExcept reports an unreleased thread- handle for every call of this snippet.
It looks like something is not released properly.
I have tried to debug this and it looks like the s7- object itself is released properly.
Can someone help?
Hi,
I program in Delphi but I don't use MadExcept.
With FastMM no issues are reported but maybe it works on different level.
Can I make the same tests also with the personal (non commercial) edition ?
Can you send me a very small complete program (XE5) that I can test showing also the setting that are you using for MadExcept ? You can use davenardella at live dot it.
The client thread is always destroyed into the object destructor.
Regards
Davide
Hi,
thanks for the quick response.
I have generated a test project with just a button on it.
Only code is:
procedure TFrmSnap7Test.btn1Click(Sender: TObject);
var s7Client: TS7Client;
begin
s7Client:=TS7Client.Create;
try
Sleep(200)
finally
s7Client.Free
end;
end;
I have removed MadExcept and other stuff.
When you watch the application with the process explorer (Sysinternals) you can see the handles growing with each click...
Regards
Andreas
Hi Andreas,
maybe too time spent around unix programming made me forget that Windows needs an additional handle destruction (CloseHandle) :(
Please, can you test it ? (ProcessExplorer now reports the handles releasing).
Thanks
Davide
Hi Davide,
looks much better now!
No more leaks reported by Processexplorer and MadExcept.
(Just ran my test- program in a loop from 1 to 100 ;-) )
Regards
Andreas
Many thanks for the support Andreas ;)
I will prepare the update fix asap.