Thema: Delphi Array korrekt freigeben

Einzelnen Beitrag anzeigen

woodie

Registriert seit: 30. Sep 2020
7 Beiträge
 
#1

Array korrekt freigeben

  Alt Heute, 14:39
Delphi-Version: 5
Hallo zusammen ich habe folgenden Code:

Code:
var AString := 'Test;1';
var AArray := AString.Split([';']);

//...

Setlength(AArray,0);
Finalize(AArray);
AArray:=nil;
Warum wird mir bei FastMM5 trotzdem ein Leak angezeigt? Was muss mit dem Array passieren, um den Leak zu unterbinden? oder ist die Split Funktion fehlerhaft?


Code:
A memory block has been leaked. The size is: 78

This block was allocated on 2025-09-23 15:28:03.379 by thread 10096, and the stack trace (return addresses) at the time was:
0096A473 [FastMM5.pas][FastMM5][FastMM_DebugGetMem_GetDebugBlock$qqrio][8039]
0096A53B [FastMM5.pas][FastMM5][FastMM_DebugGetMem$qqri][8075]
009478BA [System.pas][System][GetMem][4965]
0094CF9F [System.pas][System][NewUnicodeString][26083]
0094D1E0 [System.pas][System][UStrFromPWCharLen][26697]
0094E597 [System.pas][System][UStrCopy][32009]
009BADFF [System.SysUtils.pas][System.SysUtils][Sysutils.TStringHelper.InternalSplit][31746]
009BB040 [System.SysUtils.pas][System.SysUtils][Sysutils.TStringHelper.Split][31814]
009BAA52 [System.SysUtils.pas][System.SysUtils][Sysutils.TStringHelper.Split][31580]
01EE8B9C [Test.pas][Test][TTestItem.TestF1][1926]
  Mit Zitat antworten Zitat