关于ReportMemoryLeaksOnShutdown := true; 功能(100)

  • 主题发起人 主题发起人 delhpi
  • 开始时间 开始时间
D

delhpi

Unregistered / Unconfirmed
GUEST, unregistred user!
D2007,使用这个功能后,关闭软件时有个提示Runtime error 216 at 7C93AC4A如果根据这个地址 确定究竟是哪个单元有问题呢?我看 调试模式运行时的 EventLog,程序本身是从$00400000. 开始的Process Start: D:/xxx.exe. Base Address: $00400000. Process xxx.exe (1420)ntdll.dll倒是从 $7C920000 开始。不会是那个地方有问题吧?Module Load: ntdll.dll. No Debug Info. Base Address: $7C920000. Process xxx.exe (1420)
 
project options=>Linker=>map file=>Detailedthen open the map file to find address caller.
 
我来用fastMM检查了一下。提示有内存泄漏。似乎是软件里用到的AutoUpgradePro自动升级组件引起的。到那2个地方看了一下,水平问题,没能看出什么。map文件的方法也用过,似乎没有找到这个地址。空了再试试。--------------------------------2009/10/24 13:05:28--------------------------------A memory block has been leaked. The size is: 12This block was allocated by thread 0xBD8, and the stack trace (return addresses) at the time was:40318E [sys/system.pas][System][System.@GetMem][2654]490FC3 [auThread.pas][auThread][auThread.TauEventThread.Create][330]497DCD [auAutoUpgrader.pas][auAutoUpgrader][auAutoUpgrader.TauAutoUpgrader.Create][461]4248C4 [common/Classes.pas][Classes][Classes.CreateComponent][6503]424AF5 [common/Classes.pas][Classes][Classes.TReader.ReadComponent][6549]424DA6 [common/Classes.pas][Classes][Classes.TReader.ReadDataInner][6615]424CE5 [common/Classes.pas][Classes][Classes.TReader.ReadData][6594]4278A2 [common/Classes.pas][Classes][Classes.TComponent.ReadState][10603]485A32 [Forms.pas][Forms][Forms.TCustomForm.ReadState][3038]425BA3 [common/Classes.pas][Classes][Classes.TReader.ReadRootComponent][6996]4230F7 [common/Classes.pas][Classes][Classes.TStream.ReadComponent][5341]The block is currently used for an object of class: UnknownThe allocation number is: 15994This application has leaked memory. The small block leaks are (excluding expected leaks registered by pointer):5 - 12 bytes: Unknown x 1
 
可惜map文件里,找不到这个地址。
 
打开auThread.pas的330行看一下,这里分配的内存没有释放。
 
constructor TauEventThread.Create(aOwner: TauCustomThread);var Flags: DWORD;begin inherited Create; Owner := aOwner; AddThread; FSuspended := True; // always suspended after creation Flags := CREATE_SUSPENDED;330 FHandle := BeginThread(nil, 0, @ThreadProc, Pointer(Self), Flags, FThreadID);end;
 
试试退出前把这线程停掉,看还报不报错。
 
多人接受答案了。
 

Similar threads

S
回复
0
查看
3K
SUNSTONE的Delphi笔记
S
S
回复
0
查看
2K
SUNSTONE的Delphi笔记
S
I
回复
0
查看
652
import
I
I
回复
0
查看
812
import
I
后退
顶部