[英]FastMM showing error in release builds when closing application
I have some customers reporting an error sometimes when closing my applications:我有一些客户在关闭我的应用程序时有时会报告错误:
This is slightly surprising due to:这有点令人惊讶,因为:
GetMEM call after FastMM is unsinstalled is a bit weird (user reports he is using commandline functionality of my application, so I will try investigate that, but I do not call anything after an application is terminated. But okay, something worth investigating)卸载 FastMM 后的 GetMEM 调用有点奇怪(用户报告他正在使用我的应用程序的命令行功能,所以我会尝试对此进行调查,但在应用程序终止后我不会调用任何内容。但是好的,值得调查的事情)
I am using release mode settings, so howcome FastMM shows an error message?我正在使用发布模式设置,那么 FastMM 怎么会显示错误消息? That is the most important question for me...
这对我来说是最重要的问题...
These are the defines I am using for release builds:这些是我用于发布版本的定义:
{$undef FullDebugMode}
{$undef EnableMemoryLeakReporting}
{$undef CheckHeapForCorruption}
{$undef UseOutputDebugString}
{$undef RawStackTraces}
{$undef LogErrorsToFile}
{$undef LogMemoryLeakDetailToFile}
{$undef ClearLogFileOnStartup}
{$undef HideExpectedLeaksRegisteredByPointer}
{$define ASMVersion}
{$define AssumeMultiThreaded}
The application is multhreaded, but does not share memory manager with dlls or similar该应用程序是多线程的,但不与 dll 或类似的共享 memory 管理器
According to the FastMM source code , you can do:根据FastMM 源代码,你可以这样做:
{$undef DetectMMOperationsAfterUninstall}
To avoid this error message.为了避免这个错误信息。
Excerpt from the source code:摘自源代码:
{$ifdef DetectMMOperationsAfterUninstall}
{Invalid handlers to catch MM operations after uninstall}
function InvalidFreeMem(APointer: Pointer): {$ifdef fpc}NativeUInt{$else}Integer{$endif}; forward;
function InvalidGetMem(ASize: {$ifdef XE2AndUp}NativeInt{$else}{$ifdef fpc}NativeUInt{$else}Integer{$endif}{$endif}): Pointer; forward;
function InvalidReallocMem({$ifdef fpc}var {$endif}APointer: Pointer; ANewSize: {$ifdef XE2AndUp}NativeInt{$else}{$ifdef fpc}NativeUInt{$else}Integer{$endif}{$endif}): Pointer; forward;
function InvalidAllocMem(ASize: {$ifdef XE2AndUp}NativeInt{$else}{$ifdef fpc}NativeUint{$else}Cardinal{$endif}{$endif}): Pointer; forward;
function InvalidRegisterAndUnRegisterMemoryLeak(APointer: Pointer): Boolean; forward;
{$endif}
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.