AGB  ·  Datenschutz  ·  Impressum  







Anmelden
Nützliche Links
Registrieren
Thema durchsuchen
Ansicht
Themen-Optionen

Memory Leak?

Ein Thema von Razor · begonnen am 17. Aug 2007 · letzter Beitrag vom 17. Aug 2007
Antwort Antwort
Razor
(Gast)

n/a Beiträge
 
#1

Memory Leak?

  Alt 17. Aug 2007, 18:20
Hello!

Yes i get error when closing my application,I included the screenshot.But this error and message only show when i use FastMM(Memory Manager replacement).


Can you give me an advice on making my application faster,it takes about 3-4 secs to start?
Miniaturansicht angehängter Grafiken
untitled_203.jpg  
  Mit Zitat antworten Zitat
Benutzerbild von DGL-luke
DGL-luke

Registriert seit: 1. Apr 2005
Ort: Bad Tölz
4.149 Beiträge
 
Delphi 2006 Professional
 
#2

Re: Memory Leak?

  Alt 17. Aug 2007, 18:26
oh yeah, fastmm tells you that you have A WHOLE BUNCH of mermory leaks. You have to free all object instances you use after use.

As they mainly seem to be VCL components, maybe you are dynamically instatiating them? then you should still free them after use!
Lukas Erlacher
Suche Grafiktablett. Spenden/Gebrauchtangebote willkommen.
Gotteskrieger gesucht!
For it is the chief characteristic of the religion of science that it works. - Isaac Asimov, Foundation I, Buch 1
  Mit Zitat antworten Zitat
Razor
(Gast)

n/a Beiträge
 
#3

Re: Memory Leak?

  Alt 17. Aug 2007, 18:29
So you mean like this?

Delphi-Quellcode:
procedure tmainfrm.cpuid;
begin
 MiTeC_CPU1.RefreshData;
 RzPanel10.caption:=MiTeC_CPU1.SerialNumber;
 if mitec_cpu1.CPUIDSupported=true then
 RzPanel11.Caption:='Yes'
 else
 RzPanel11.Caption:='No';
end;
MiTeC_CPU1.free;
 RzPanel10.caption.free;

end;
  Mit Zitat antworten Zitat
Benutzerbild von Phoenix
Phoenix
(Moderator)

Registriert seit: 25. Jun 2002
Ort: Hausach
7.617 Beiträge
 
#4

Re: Memory Leak?

  Alt 17. Aug 2007, 19:16
Actually the how is correct. But the where or better: when is wrong.

Every control you create dynamically, you need to free in the destructor of the owner. That is - in that case - the destructor of the Form.
Sebastian Gingter
Phoenix - 不死鳥, Microsoft MVP, Rettungshundeführer
Über mich: Sebastian Gingter @ Thinktecture Mein Blog: https://gingter.org
  Mit Zitat antworten Zitat
Antwort Antwort


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 15:04 Uhr.
Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024 by Thomas Breitkreuz