Einzelnen Beitrag anzeigen

Renate Schaaf

Registriert seit: 25. Jun 2020
Ort: Lippe
114 Beiträge
 
Delphi 11 Alexandria
 
#11

AW: Wie benutzt man MadExcept Memory Leak Detection?

  Alt 22. Feb 2021, 17:28
Hallo,

Eine Stelle habe ich gefunden in VirtualExplorerTree (siehe ///!!!):

Delphi-Quellcode:
procedure TCustomVirtualExplorerTree.RebuildRootNamespace;
{ This will call InitNode for the root which will look at the FRootFolderNamespace }
{ and rebuild with that as its root after clearing the tree.                       }
var
  NewNodeData: PNodeData;
begin
  if (RebuildRootNamespaceCount = 0) and ShellNotifyManager.OkToDispatch then
  begin
    if not (csLoading in ComponentState) and Assigned(FRootFolderNamespace) then
    begin
      if Active then
      begin
        BeginUpdate;
        try
          if ThreadedImagesEnabled then
            GlobalThreadManager.FlushMessageCache(Self, TID_ICON);
          if ThreadedExpandMarkEnabled then
            ExpandMarkThreadManager.FlushMessageCache(Self, TID_EXPANDMARK);

          // Stupid, clear AFTER flushing! July 8, 2008
          Clear;

          if not(toHideRootFolder in TreeOptions.VETFolderOptions) then
          begin
            NewNodeData := InternalData(RootNode);
            FreeAndNil(NewNodeData.Namespace);
            RootNodeCount := 1;
          end else
          begin
            NewNodeData := InternalData(RootNode);
            if Assigned(NewNodeData) then
            begin
              FreeAndNil(NewNodeData.Namespace);
              NewNodeData.Namespace := TNamespace.Create(PIDLMgr.CopyPIDL(FRootFolderNamespace.AbsolutePIDL), nil);
              //////////!!!!!!!!!!!!!!!!!!!!!!
              RegisterExpectedMemoryLeak(NewNodeData.Namespace);
              /////////!!!!!!!!!!!!!!!!!!!!!!!
              ExpandNamespaceFolder(RootNode);
            end
          end;
        finally
          EndUpdate;
          FocusedNode := GetFirst;
          ChangeLinkDispatch;
          DoRootRebuild
        end;
      end
    end
  end
end;
Die 2 Namespaces werden nicht freigegeben sowie man irgendwo einen VirtualExplorerListView benutzt.

Den 2. hab ich nicht gefunden, MadExcept finde ich da etwas kryptisch. FastMM4 werde ich nicht benutzen, es hat mir schon einmal was zerschossen. Hoffe, das bringt dich etwas weiter.
Renate
  Mit Zitat antworten Zitat