Re: [fpc-pascal] gtree - Freeing a nil Root without error

2014-01-08 Thread Daniel Gaspary
On Wed, Jan 8, 2014 at 3:31 AM, leledumbo wrote: > As in the data structure theory, a tree is just a graph without cycle. > So I guess it should be made that way. There are a lot of graph and tree > variations though, so I think I need to take some time to design before > implementing. I don't kn

Re: [fpc-pascal] gtree - Freeing a nil Root without error

2014-01-07 Thread leledumbo
Actually, I'm planning on redesigning gtree to be a part of larger ggraph unit. As in the data structure theory, a tree is just a graph without cycle. So I guess it should be made that way. There are a lot of graph and tree variations though, so I think I need to take some time to design before imp

Re: [fpc-pascal] gtree - Freeing a nil Root without error

2014-01-07 Thread Daniel Gaspary
On Tue, Jan 7, 2014 at 6:55 PM, Daniel Gaspary wrote: > Thank you, Marco. > > I was searching in stl package for a "Graph" type. is there such type? Answering to myself... I believe the Graph types exist only in Lazarus LazControls package, unit LvlGraphCtrl. ___

Re: [fpc-pascal] gtree - Freeing a nil Root without error

2014-01-07 Thread Daniel Gaspary
On Tue, Jan 7, 2014 at 6:27 PM, Marco van de Voort wrote: > Free only calls the destructor if self isn't nil. Thank you, Marco. I was searching in stl package for a "Graph" type. is there such type? ___ fpc-pascal maillist - fpc-pascal@lists.freepasc

Re: [fpc-pascal] gtree - Freeing a nil Root without error

2014-01-07 Thread Marco van de Voort
In our previous episode, Daniel Gaspary said: >gtree.TTree type has the following code: > > How is possible then that the following program don't raise an error > when the destructor (via free) is called? Free only calls the destructor if self isn't nil. procedure TObject.Free;

[fpc-pascal] gtree - Freeing a nil Root without error

2014-01-07 Thread Daniel Gaspary
Hi, gtree.TTree type has the following code: constructor TTree.Create; begin FRoot := nil; end; destructor TTree.Destroy; begin FRoot.Free; end; How is possible then that the following program don't raise an error when the destructor (via free) is called? program Project1; {$mode objf