<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type">
<title></title>
</head>
<body bgcolor="#ffffff" text="#000000">
Andrew Brunner escribió:
<blockquote
cite="mid:a2922880903200739oe4f929qf4e181948dfbc9c1@mail.gmail.com"
type="cite">
<pre wrap="">What do you do with the Create, Execute and Destroy methods? Meaning
are you declaring any Streams, Objects or Structures and not freeing
them? Or is this problem replicated by just barely implementing
threads?
</pre>
<blockquote type="cite">
<pre wrap="">I have an application which uses Threads, memory usage by the application
does not diminish, but increases each time you create the threads and
finish, I think that is a problem with memory management in Free Pascal
2.2.2
OS: Ubuntu Linux
Lazarus 0.9.26
--
Lic. Liyuán García Caballero
Especialista B en Ciencias Informáticas
Excelencia en Software
Desoft Ciego de Ávila.
Calle 2 y Joaquín de Agüero. Ciego de Ávila. Cuba.
<a class="moz-txt-link-abbreviated" href="mailto:liyuan@cav.desoft.cu">liyuan@cav.desoft.cu</a>
<a class="moz-txt-link-abbreviated" href="mailto:liyuan@jabber.cav.desoft.cu">liyuan@jabber.cav.desoft.cu</a>
Ubuntu Linux
_______________________________________________
Lazarus mailing list
<a class="moz-txt-link-abbreviated" href="mailto:Lazarus@lazarus.freepascal.org">Lazarus@lazarus.freepascal.org</a>
<a class="moz-txt-link-freetext" href="http://www.lazarus.freepascal.org/mailman/listinfo/lazarus">http://www.lazarus.freepascal.org/mailman/listinfo/lazarus</a>
</pre>
</blockquote>
<pre wrap=""><!---->
</pre>
</blockquote>
Check my Thread code:<br>
<br>
procedure Tcheckonline.Execute;<br>
begin<br>
sock.HTTPTunnelTimeout := 10000;<br>
query.FileName:=vpathdb;<br>
query.SQL:='SELECT * FROM computer WHERE name='''+vhost+''';';<br>
query.Open;<br>
if query.FieldByName('proxy').Value then<br>
begin<br>
if query.FieldByName('proxy_type').AsString = 'HTTP' then<br>
begin<br>
sock.HTTPTunnelIP := query.FieldByName('proxy_host').AsString;<br>
sock.HTTPTunnelPort := query.FieldByName('proxy_port').AsString;<br>
sock.HTTPTunnelUser := query.FieldByName('proxy_user').AsString;<br>
sock.HTTPTunnelPass := query.FieldByName('proxy_pass').AsString;<br>
sock.Connect(query.FieldByName('ip').AsString+<br>
':'+query.FieldByName('port').AsString,'0');<br>
end;<br>
end else<br>
sock.Connect(query.FieldByName('ip').AsString,query.FieldByName('port').AsString);<br>
sock.SendString('noop;' + #10);<br>
if parse_proto('noop',sock.RecvPacket(500)) = 'ok' then<br>
begin<br>
vimg:=1;<br>
Synchronize(@putstatus);<br>
end else<br>
begin<br>
vimg:=0;<br>
Synchronize(@putstatus);<br>
end;<br>
sock.Free;<br>
query.Free;<br>
Terminate;<br>
end;<br>
<br>
procedure Tcheckonline.putstatus;<br>
begin<br>
fprincipal.tvnode.Items[fprincipal.tvnode.Items.FindNodeWithText(vhost).Index].SelectedIndex:=vimg;<br>
fprincipal.tvnode.Items[fprincipal.tvnode.Items.FindNodeWithText(vhost).Index].ImageIndex:=vimg;<br>
end;<br>
<br>
function Tcheckonline.parse_proto(command, data: String): String;<br>
var<br>
str : String;<br>
ini, fin : Integer;<br>
begin<br>
ini := Pos(command,data);<br>
fin := Pos('=',data);<br>
str := copy(data,ini,fin-ini);<br>
if str = command then<br>
Begin<br>
ini := Pos('=',data)+1;<br>
fin := Pos(';',data);<br>
str := copy(data,ini,fin-ini);<br>
Result := str;<br>
end<br>
end;<br>
<br>
constructor Tcheckonline.create(CreateSuspended: Boolean; ahost,
apathdb: String);<br>
begin<br>
sock:= TTCPBlockSocket.Create;<br>
query := TSqlite3Dataset.Create(nil);<br>
vpathdb:=apathdb;<br>
vhost := ahost;<br>
FreeOnTerminate:=True;<br>
inherited Create(CreateSuspended);<br>
end;<br>
<br>
<div class="moz-signature">-- <br>
<meta content="text/html; charset=ISO-8859-1" http-equiv="content-type">
<title>Firma</title>
<p class="MsoNormal" style=""><b><span
style="font-size: 14pt; font-family: "Verdana","sans-serif"; color: rgb(30, 52, 146);"
lang="ES-TRAD">Lic. Liyuán García Caballero</span></b><b><span
style="font-family: "Verdana","sans-serif"; color: navy;"
lang="ES-TRAD"><br>
</span></b><span
style="font-size: 10pt; font-family: "Verdana","sans-serif"; color: rgb(0, 51, 102);"
lang="ES-TRAD"> </span><b><span
style="font-size: 9pt; font-family: "Verdana","sans-serif"; color: rgb(153, 153, 153);">Especialista
B en Ciencias Informáticas</span></b><o:p></o:p></p>
<b><span
style="font-family: "Verdana","sans-serif"; color: rgb(30, 52, 146);"
lang="ES-TRAD">Excelencia en Software<br>
</span></b><span
style="font-size: 8pt; font-family: "Verdana","sans-serif"; color: rgb(30, 52, 146);"
lang="ES-TRAD">Desoft Ciego de Ávila. <br>
Calle 2 y Joaquín de
Agüero. Ciego de Ávila. Cuba.<br>
<img style="width: 22px; height: 22px; float: left;" alt="e-mail:"
src="cid:part1.09090501.06030404@cav.desoft.cu"> <b><a class="moz-txt-link-abbreviated" href="mailto:liyuan@cav.desoft.cu">liyuan@cav.desoft.cu</a><br>
</b><img style="width: 22px; height: 22px; float: left;" alt="jabber:"
src="cid:part2.02000608.08020508@cav.desoft.cu"><b>
<a class="moz-txt-link-abbreviated" href="mailto:liyuan@jabber.cav.desoft.cu">liyuan@jabber.cav.desoft.cu</a><br>
<img style="width: 22px; height: 22px; float: left;" title="Ubuntu"
alt="SO:" src="cid:part3.01040202.04070607@cav.desoft.cu"></b><b>Ubuntu
Linux</b></span></div>
</body>
</html>