Re: [fpc-pascal] Something like g_object_get() in Pascal?

2010-08-01 Thread Matthias Klumpp
On Sun, 01 Aug 2010 19:57:28 +0200, Matthias Klumpp wrote: > On Sun, 01 Aug 2010 19:27:20 +0200, Bernd Kreuss > wrote: >> On 01.08.2010 14:45, Matthias Klumpp wrote: >> >>> Because Pascal records are incompatible with C structs >> >> how are they incompatible? It should be possible to define th

Re: [fpc-pascal] Something like g_object_get() in Pascal?

2010-08-01 Thread Matthias Klumpp
On Sun, 01 Aug 2010 19:27:20 +0200, Bernd Kreuss wrote: > On 01.08.2010 14:45, Matthias Klumpp wrote: > >> Because Pascal records are incompatible with C structs > > how are they incompatible? It should be possible to define the same > record as a struct in C and for every struct in C it should

Re: [fpc-pascal] Something like g_object_get() in Pascal?

2010-08-01 Thread Bernd Kreuss
On 01.08.2010 14:45, Matthias Klumpp wrote: > Because Pascal records are incompatible with C structs how are they incompatible? It should be possible to define the same record as a struct in C and for every struct in C it should be possible to define the same as a record in Pascal. Then you could

Re: [fpc-pascal] TObjectList works; TFPObjectList gives memory leaks

2010-08-01 Thread Jim
On 1-8-2010 14:29, Marco van de Voort wrote: > In our previous episode, Marco van de Voort said: >> >> Call inherited create(true) in your constructor instead of just create(). > > Hmm no, that is not it either, since the constructor is overloaded. Then a > small example program to test is really

[fpc-pascal] Something like g_object_get() in Pascal?

2010-08-01 Thread Matthias Klumpp
Hello! I have a record containing a set of variables. This record should now be accessed from an application developed in C (through a shared library). Because Pascal records are incompatible with C structs, I could write a get_value() function for each value in the record, e.g. if I have: TTestRe

Re: [fpc-pascal] TObjectList works; TFPObjectList gives memory leaks

2010-08-01 Thread Marco van de Voort
In our previous episode, Marco van de Voort said: > > Call inherited create(true) in your constructor instead of just create(). Hmm no, that is not it either, since the constructor is overloaded. Then a small example program to test is really needed. If you can reproduce it, please file a bug at

Re: [fpc-pascal] TObjectList works; TFPObjectList gives memory leaks

2010-08-01 Thread Marco van de Voort
In our previous episode, Jim said: > > Still working on my file indexer: > http://bitbucket.org/jb/flocate/changeset/6c6fa90e632e The question should be why tobjectlist works. Since you don't set the "freeobjects" anywhere. Call inherited create(true) in your constructor instead of just create()

[fpc-pascal] TObjectList works; TFPObjectList gives memory leaks

2010-08-01 Thread Jim
Hi all, Still working on my file indexer: http://bitbucket.org/jb/flocate/changeset/6c6fa90e632e Each search for files creates a TObjectList descendant (TDirectoryEntryList, see directoryentrylist.pp) On finding a file, the search class createa a DirectoryEntry object with the relevant file prop