AGB  ·  Datenschutz  ·  Impressum  







Anmelden
Nützliche Links
Registrieren
Zurück Delphi-PRAXiS Programmierung allgemein Netzwerke Delphi IdTCPServer + MemoryLeak
Thema durchsuchen
Ansicht
Themen-Optionen

IdTCPServer + MemoryLeak

Ein Thema von azury · begonnen am 17. Feb 2010 · letzter Beitrag vom 8. Apr 2010
 
azury

Registriert seit: 18. Dez 2008
8 Beiträge
 
#5

Re: IdTCPServer + MemoryLeak

  Alt 17. Feb 2010, 18:51
//Edit

Okay den Integer hab ich geschafft wegzubekommen aber es ist nur einmal TIdCriticalSection drin
mal gucken ob ich den auch noch raus bekomme....
Okay nun sind beide raus.

Einmal im IdThread
Delphi-Quellcode:
  // This call hangs if not all threads have been properly destroyed.
  // But without this, bad threads can often have worse results. Catch 22.
  TIdThread.WaitAllThreadsTerminated;
  FreeAndNil(GThreadCount);
Das war ausgeklammert, wie dort beschrieben.

Und einmal im IdComponent:
Delphi-Quellcode:
destructor TIdComponent.Destroy;
begin
  inherited;
  // After inherited - do at last possible moment
  GStackCriticalSection.Acquire; try
    Dec(GInstanceCount);
    if GInstanceCount = 0 then begin
      // This CS will guarantee that during the FreeAndNil nobody will try to use
      // or construct GStack
      FreeAndNil(GStack);
    end;
  finally
    GStackCriticalSection.Release;
    FreeAndNil(GStackCriticalSection);
  end;
Da hab ich einfach das FreeAndNil(GStackCriticalSection); angefügt.
Keine Ahnung ob das okay ist was ich da mache, aber es entstehen keine Memleaks mehr.
Wenn einer gute gründe hat warum man das nicht machen sollte, immer her damit.
  Mit Zitat antworten Zitat
 


Forumregeln

Es ist dir nicht erlaubt, neue Themen zu verfassen.
Es ist dir nicht erlaubt, auf Beiträge zu antworten.
Es ist dir nicht erlaubt, Anhänge hochzuladen.
Es ist dir nicht erlaubt, deine Beiträge zu bearbeiten.

BB-Code ist an.
Smileys sind an.
[IMG] Code ist an.
HTML-Code ist aus.
Trackbacks are an
Pingbacks are an
Refbacks are aus

Gehe zu:

Impressum · AGB · Datenschutz · Nach oben
Alle Zeitangaben in WEZ +1. Es ist jetzt 22:47 Uhr.
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024-2025 by Thomas Breitkreuz