Detected resource leak to early
Detected resource leak to early
Hello,
i try using madexcept to detect memory leaks. (Tokio)
While debuging i came throu "class function TEncoding.GetUnicode: TEncoding;" in unit unit System.SysUtils where a TUnicodeEncoding is created.
It is freed in class destructor TEncoding.Destroy; but after madexcept reports leaks.
What can i do?
i try using madexcept to detect memory leaks. (Tokio)
While debuging i came throu "class function TEncoding.GetUnicode: TEncoding;" in unit unit System.SysUtils where a TUnicodeEncoding is created.
It is freed in class destructor TEncoding.Destroy; but after madexcept reports leaks.
What can i do?
Re: Detected resource leak to early
madExcept's leak reporting is done in madExcept32.dll, and it should be done after your EXE has already fully finalized (after all the "finalization" sections have run through). So how can that be too early?
Re: Detected resource leak to early
Hello,
i don't know how and why. Lets explain.
I have a project named "TestQrtInfrastructure". It requires some packages. In the file "TestQrtInfrastructure.dpr" the uses starts with "madExcept".
When i start the project, the ui appears (DUnit). Then i close the app. Then in this order
- the form disapers
- a small window from madexcept apers to collect leaks
- a windows named madexcept view apears showing leaks
- delphi stoppes at a breakpoint in unit System.SysUtils in class destructor TEncoding.Destroy;
I would expect this order:
- the form disapers
- delphi stoppes at a breakpoint in unit System.SysUtils in class destructor TEncoding.Destroy;
- a small window from madexcept apers to collect leaks
- a windows named madexcept view apears showing leaks
i don't know how and why. Lets explain.
I have a project named "TestQrtInfrastructure". It requires some packages. In the file "TestQrtInfrastructure.dpr" the uses starts with "madExcept".
When i start the project, the ui appears (DUnit). Then i close the app. Then in this order
- the form disapers
- a small window from madexcept apers to collect leaks
- a windows named madexcept view apears showing leaks
- delphi stoppes at a breakpoint in unit System.SysUtils in class destructor TEncoding.Destroy;
I would expect this order:
- the form disapers
- delphi stoppes at a breakpoint in unit System.SysUtils in class destructor TEncoding.Destroy;
- a small window from madexcept apers to collect leaks
- a windows named madexcept view apears showing leaks
Re: Detected resource leak to early
Hmmmm... That seems somewhat weird. Two questions:
1) I suppose that breakpoint in System.SysUtils is inside of RTL.bpl?
2) I suppose madExcept is linked into your EXE file? Or are you using madExcept_.bpl as a runtime package?
1) I suppose that breakpoint in System.SysUtils is inside of RTL.bpl?
2) I suppose madExcept is linked into your EXE file? Or are you using madExcept_.bpl as a runtime package?
Re: Detected resource leak to early
Hm, how do i know?
In "the Event Log" there is a "Module Load: rtl250.bpl. Has Debug Info. ...", therefore i assume yes to 1.
There is a "Module Load: madExcept32.dll ..." too. Can i assume no for 2.?
Now i add "madBasic_;madDisAsm_;madExcept_" to "Runtime Packackes" in the project options, but the problem still occurs.
In "the Event Log" there is a "Module Load: rtl250.bpl. Has Debug Info. ...", therefore i assume yes to 1.
There is a "Module Load: madExcept32.dll ..." too. Can i assume no for 2.?
Now i add "madBasic_;madDisAsm_;madExcept_" to "Runtime Packackes" in the project options, but the problem still occurs.
Re: Detected resource leak to early
Hmmmm... Can you reproduce this problem in a brand new almost empty test project? That would allow me to reproduce the problem on my PC, which would make it much easier for me to analyze the situation in detail.
-
- Posts: 10
- Joined: Sat Oct 08, 2016 1:55 pm
Re: Detected resource leak to early
i created a new post , but it is the same as
viewtopic.php?f=4&t=28605
the problem is in RTL and MADEXCEPT work too early
viewtopic.php?f=4&t=28605
the problem is in RTL and MADEXCEPT work too early