Re: [fpc-pascal] memory leak in TCustomSQLQuery.Create

2014-12-29 Thread Michael Van Canneyt
On Mon, 29 Dec 2014, Michael Van Ham wrote: Hello, In TCustomSQLQuery.Create, FRefreshSQL:TStringList is created on line 2095, but never freed. This causes a small memory leak. Please see the attached test program demonstrating the issue. Reported on the bugtracker here: http://bugs.freepa

[fpc-pascal] memory leak in TCustomSQLQuery.Create

2014-12-29 Thread Michael Van Ham
Hello, In TCustomSQLQuery.Create, FRefreshSQL:TStringList is created on line 2095, but never freed. This causes a small memory leak. Please see the attached test program demonstrating the issue. Reported on the bugtracker here: http://bugs.freepascal.org/view.php?id=27220 Please review the atta

Re: [fpc-pascal] Memory leak on TFPGInterfacedObjectList

2014-01-27 Thread Joao Morais
Em 27/01/14 20:39, Marco van de Voort escreveu: In our previous episode, Joao Morais said: Hello list. Whenever I add interfaced objects to a TFPGInterfacedObjectList, those objects apparently add two references, while release only one when the list is cleaned or destroyed. v1 reference will on

Re: [fpc-pascal] Memory leak on TFPGInterfacedObjectList

2014-01-27 Thread Marco van de Voort
In our previous episode, Joao Morais said: > > Hello list. Whenever I add interfaced objects to a > TFPGInterfacedObjectList, those objects apparently add two references, > while release only one when the list is cleaned or destroyed. v1 reference will only be freed at the end, and also counts

[fpc-pascal] Memory leak on TFPGInterfacedObjectList

2014-01-27 Thread Joao Morais
Hello list. Whenever I add interfaced objects to a TFPGInterfacedObjectList, those objects apparently add two references, while release only one when the list is cleaned or destroyed. The following code shows: ==>>>== $ /tmp/project1 just before vl.add(v1)..: 1 just after vl.

Re: [fpc-pascal] Memory leak in GetEnumerator

2013-12-27 Thread Xiangrong Fang
You are right, the bug is fixed, and another bug in the GetEnumerator are also found and fixed. This is my first time using heaptrc. Thanks a lot. 2013/12/27 Jeppe Græsdal Johansen > Den 27-12-2013 10:16, Xiangrong Fang skrev: > > Hi All, > > I used HeapTrc on my TTreap class: > > https:/

Re: [fpc-pascal] Memory leak in GetEnumerator

2013-12-27 Thread Jeppe Græsdal Johansen
Den 27-12-2013 10:16, Xiangrong Fang skrev: Hi All, I used HeapTrc on my TTreap class: https://github.com/xrfang/fpcollection/blob/master/src/units/treap.pas It reported memory leak in the following procedure: function TTreap.GetEnumerator: TTreap; begin Result := TTreap.Create; //<-- memory

[fpc-pascal] Memory leak in GetEnumerator

2013-12-27 Thread Xiangrong Fang
Hi All, I used HeapTrc on my TTreap class: https://github.com/xrfang/fpcollection/blob/master/src/units/treap.pas It reported memory leak in the following procedure: function TTreap.GetEnumerator: TTreap; begin Result := TTreap.Create; //<-- memory leak here Result.ProxyFor := Self; ...

[fpc-pascal] Memory leak in PascalScript

2013-11-25 Thread silvioprog
Hello, Can you help me to fix this issue?: https://github.com/remobjects/pascalscript/issues/61 Thank you! -- Silvio Clécio My public projects - github.com/silvioprog ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal

[fpc-pascal] Memory leak in PascalScript

2013-09-25 Thread silvioprog
Hello, Can you help me to fix this issue?: https://github.com/remobjects/pascalscript/issues/61 Thank you! -- Silvio Clécio My public projects - github.com/silvioprog ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal

Re: [fpc-pascal] Memory leak

2011-12-18 Thread dhkblaszyk
On 18 dec '11, Jonas Maebe wrote: > If you use freemem or reallocmem, then you will get a memory leak because freemem/reallocmem do not finalize the memory before freeing it. You have to manually call finalize() on the records inside that memory block prior to freeing them via freemem/realloc

Re: [fpc-pascal] Memory leak

2011-12-18 Thread dhkblaszyk
On 18 dec '11, Jonas Maebe wrote: > On 18 Dec 2011, at 15:45, dhkblas...@zeelandnet.nl [1]wrote: > >> It was an ansistring indeed, and finalize did the trick! Thanks for your help. How does New and Dispose work btw? Do they use RTTI to call finalize appropriatly? > > Yes. > >> I tried sear

Re: [fpc-pascal] Memory leak

2011-12-18 Thread Jonas Maebe
On 18 Dec 2011, at 15:45, dhkblas...@zeelandnet.nl wrote: > It was an > ansistring indeed, and finalize did the trick! Thanks for your help. How > does New and Dispose work btw? Do they use RTTI to call finalize > appropriatly? Yes. > I tried searching the New and Dispose implementations in > t

Re: [fpc-pascal] Memory leak

2011-12-18 Thread dhkblaszyk
On 18 dec '11, Jonas Maebe wrote: > On 18 Dec 2011, at 14:04, dhkblas...@zeelandnet.nl [1]wrote: > >> mytest^.name := Format('%s.%.3d', ['name', 1]); This assigns 'name.001' to the pointer variable but causes a memleak. If I assign the same value as string constant no memleak occurs, so it m

Re: [fpc-pascal] Memory leak

2011-12-18 Thread Jonas Maebe
On 18 Dec 2011, at 14:04, dhkblas...@zeelandnet.nl wrote: > mytest^.name := Format('%s.%.3d', ['name', 1]); > > This assigns > 'name.001' to the pointer variable but causes a memleak. If I assign the > same value as string constant no memleak occurs, so it must be something > related to format.

[fpc-pascal] Memory leak

2011-12-18 Thread dhkblaszyk
While dabbling with pointers, I came across a memleak for which I don't understand why it happens. Hopefully someone can help me with it. mytest^.name := Format('%s.%.3d', ['name', 1]); This assigns 'name.001' to the pointer variable but causes a memleak. If I assign the same value as strin

Re: [fpc-pascal] Memory leak or object destruction?

2011-02-03 Thread Andreas Schneider
On Wed, 2 Feb 2011 21:09:42 -0800, Andrew Hall wrote: Interfaces support reference counting. Only COM interfaces, but they are currently the default anyway. ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailma

Re: [fpc-pascal] Memory leak or object destruction?

2011-02-02 Thread Andrew Hall
Interfaces support reference counting. ISomeObject = interface TSomeObject = class(TinterfacedObject, ISomeObject) var MyObj: ISomeObject; Regards, On 02 Feb 11, at 15:22 , Bo Berglund wrote: > Will this create a memory leak or will FPC fnd by reference counting > that nothing references the

Re: [fpc-pascal] Memory leak or object destruction?

2011-02-02 Thread Michael Van Canneyt
On Thu, 3 Feb 2011, Bo Berglund wrote: I am curious as to how FPC handles the following situations: var MyObj: TsomeObject; begin MyObj := TsomeObject.Create; // do some processing MyObj := NIL; end; Will this create a memory leak or will FPC fnd by reference counting that nothing refere

[fpc-pascal] Memory leak or object destruction?

2011-02-02 Thread Bo Berglund
I am curious as to how FPC handles the following situations: var MyObj: TsomeObject; begin MyObj := TsomeObject.Create; // do some processing MyObj := NIL; end; Will this create a memory leak or will FPC fnd by reference counting that nothing references the object memory and dispose of it

Re: [fpc-pascal] memory leak detection using FPC

2006-09-19 Thread Leonardo M. Ram
That's true, because of that i don't use interfaces in FPC, instead i use virtual abstract classes. --- Inoussa OUEDRAOGO <[EMAIL PROTECTED]> wrote: > hi > I reported a bug for interface reference counting at > http://www.freepascal.org/mantis/view.php?id=7281 > > Bellow is the test program. >

Re: [fpc-pascal] memory leak detection using FPC

2006-09-19 Thread Inoussa OUEDRAOGO
hi I reported a bug for interface reference counting at http://www.freepascal.org/mantis/view.php?id=7281 Bellow is the test program. Regards, Inoussa. program test_intf; {$mode objfpc}{$H+} uses SysUtils; type ITest = interface procedure DoIt(AMsg : string); end;

Re: [fpc-pascal] memory leak detection using FPC

2006-09-19 Thread Graeme Geldenhuys
Yes I'm using fpc 2.1.1 with 40 bytes reported. Thanks for the update Vincent! PS: I'm grad to report that with my new found knowledge, fpGUI and fpGFX is now memory leak free! :-) Regards, - Graeme - ___ fpc-pascal maillist - fpc-pascal@lists.fre

Re: [fpc-pascal] memory leak detection using FPC

2006-09-19 Thread Vincent Snijders
Jonas Maebe schreef: On 19 sep 2006, at 09:33, Graeme Geldenhuys wrote: So what is wrong with this code then... When I quit the app, it says I have one memory leak. What am I not freeing? If you compile the rtl with line info, you'll see the non-freed object is in the RTL: Call trace for

Re: [fpc-pascal] memory leak detection using FPC

2006-09-19 Thread Graeme Geldenhuys
Hi Michael, Try putting everyting in a procedure 'Test' and run that. I did that and still see the unfreed memory error. I think Jonas might be onto something. I used the tiBaseObject unit from tiOPF. It has memory leak detection (derived from the IndySOAP project), but only if your classes

Re: [fpc-pascal] memory leak detection using FPC

2006-09-19 Thread Jonas Maebe
On 19 sep 2006, at 09:33, Graeme Geldenhuys wrote: So what is wrong with this code then... When I quit the app, it says I have one memory leak. What am I not freeing? If you compile the rtl with line info, you'll see the non-freed object is in the RTL: Call trace for block $00187260 size

Re: [fpc-pascal] memory leak detection using FPC

2006-09-19 Thread Michael Van Canneyt
On Tue, 19 Sep 2006, Graeme Geldenhuys wrote: So what is wrong with this code then... When I quit the app, it says I have one memory leak. What am I not freeing? Try putting everyting in a procedure 'Test' and run that. Global variables (even temporary ones) may not yet have been deallocat

Re: [fpc-pascal] memory leak detection using FPC

2006-09-19 Thread Graeme Geldenhuys
So what is wrong with this code then... When I quit the app, it says I have one memory leak. What am I not freeing? - program memleak; {$mode objfpc}{$H+} uses {$IFDEF UNIX}{$IFDEF UseCThreads} cthreads, {$ENDIF}{$ENDIF} Classes, SysUtils; type

Re: [fpc-pascal] memory leak detection using FPC

2006-09-19 Thread Graeme Geldenhuys
On 19/09/06, Michael Van Canneyt <[EMAIL PROTECTED]> wrote: Just add -gh to the compiler command-line. Run your project from a console, so you can see standard output. When the program is finished, it will give you a detailed list of memory leaks. Oops, so all the lines scrolling off the scr

Re: [fpc-pascal] memory leak detection using FPC

2006-09-19 Thread Michael Van Canneyt
On Tue, 19 Sep 2006, Graeme Geldenhuys wrote: Hi, How do you do memory leak detection using FPC? I know about the -gh parameter, but don't know how to use it, or with what other tools. I develop under Linux on x86. Just add -gh to the compiler command-line. Run your project from a consol

[fpc-pascal] memory leak detection using FPC

2006-09-19 Thread Graeme Geldenhuys
Hi, How do you do memory leak detection using FPC? I know about the -gh parameter, but don't know how to use it, or with what other tools. I develop under Linux on x86. Regards, - Graeme - -- There's no place like 127.0.0.1 ___ fpc-pascal maillist

Re: [fpc-pascal]Memory leak in freepascal, FreeAndNil not working properly?

2004-06-23 Thread Anton Tichawa
Matt Emson wrote: You code is wrong, it also crashes with kylix. What kind of answer is this? The correct one? To remove an item from a TList you must: (a) set it to nil and pack the list e.g. list[0] := nil; list.pack; (b) call TList.Delete(index) e.g. list.delete(0); (c) use TList.

Re: [fpc-pascal]Memory leak in freepascal, FreeAndNil not working properly?

2004-06-23 Thread Matt Emson
> > You code is wrong, it also crashes with kylix. > > What kind of answer is this? The correct one? To remove an item from a TList you must: (a) set it to nil and pack the list e.g. list[0] := nil; list.pack; (b) call TList.Delete(index) e.g. list.delete(0); (c) use TList.Remove(poi

Re: [fpc-pascal]Memory leak in freepascal, FreeAndNil not working properly?

2004-06-23 Thread Peter Vreman
>> You code is wrong, it also crashes with kylix. > > What kind of answer is this? That it is not working in Kylix either does > certainly not mean their memory handling is correct. Kylix and Delphi are the references whether special constructions should work or not. See Michael's answer what is

Re: [fpc-pascal]Memory leak in freepascal, FreeAndNil not working properly?

2004-06-23 Thread Andreas Gros
> You code is wrong, it also crashes with kylix. What kind of answer is this? That it is not working in Kylix either does certainly not mean their memory handling is correct. Please look at the code. The crash is supposed to happen, because it is the same object, that is addressed both times I

Re: [fpc-pascal]Memory leak in freepascal, FreeAndNil not working properly?

2004-06-23 Thread Michael Van Canneyt
On Wed, 23 Jun 2004, Andreas Gros wrote: > Hi folks, > > please check out this code (unit). Certainly there is something very strange > going on in handling memory in freepascal. I'm using Free Pascal Compiler > version 1.9.4 [2004/05/30] for i386. > > Thanks in advance for replying. > > Andreas

Re: [fpc-pascal]Memory leak in freepascal, FreeAndNil not working properly?

2004-06-23 Thread Peter Vreman
> Hi folks, > > please check out this code (unit). Certainly there is something very > strange > going on in handling memory in freepascal. I'm using Free Pascal Compiler > version 1.9.4 [2004/05/30] for i386. > You code is wrong, it also crashes with kylix. __

[fpc-pascal]Memory leak in freepascal, FreeAndNil not working properly?

2004-06-23 Thread Andreas Gros
Hi folks, please check out this code (unit). Certainly there is something very strange going on in handling memory in freepascal. I'm using Free Pascal Compiler version 1.9.4 [2004/05/30] for i386. Thanks in advance for replying. Andreas { snip%<***