Re[6]: [fpc-pascal] TIniFile crash/memory loss

2011-04-01 Thread José Mejuto
Hello FPC-Pascal, Friday, April 1, 2011, 12:17:30 AM, you wrote: B The job of the destructor, however, is to clean up the object and return memory. B This should never fail IMHO. The clean up has not been successfully performed as in this class a file update is part of the clean up. There are

Re: Re[4]: [fpc-pascal] TIniFile crash/memory loss

2011-04-01 Thread Michael Van Canneyt
On Fri, 1 Apr 2011, Bart wrote: On 3/31/11, José Mejuto joshy...@gmail.com wrote: B This however means that the programmer has to protect TIniFile.Free B with a Try..Except block, which is also rather unusual. It's unusual, but there is an error, or the class does not perform the save in

Re: Re[4]: [fpc-pascal] TIniFile crash/memory loss

2011-04-01 Thread Marco van de Voort
In our previous episode, Michael Van Canneyt said: Going back to 1 is not an option. For case 2, I am inclined to say that the destructor must always succeed. Errors in destructors are very ugly to trap. ... time to mark tinifile as deprecated ? ___

Re[6]: [fpc-pascal] TIniFile crash/memory loss

2011-04-01 Thread José Mejuto
Hello FPC-Pascal, Friday, April 1, 2011, 9:58:24 AM, you wrote: MVC 2. Cache the updates, and make sure they are written when the instance is destroyed. MVC This is the current behaviour. It works fast, but the corner case you encountered MVC (an error when updating the file in the

Re: Re[6]: [fpc-pascal] TIniFile crash/memory loss

2011-04-01 Thread DaWorm
On Fri, Apr 1, 2011 at 6:28 AM, José Mejuto joshy...@gmail.com wrote: An exception in free is an extreme rare condition, but it could happend, and is better that your software stops to work than notify 2 years later that your 2 zillions of INI files were not written at all because the user

Re: Re[6]: [fpc-pascal] TIniFile crash/memory loss

2011-04-01 Thread Bart
On 4/1/11, DaWorm daw...@gmail.com wrote: The test case was an invalid filename. Is this the primary failure method? This was merely to demonstrate the possibility of the destructor failing. Bart ___ fpc-pascal maillist -

[fpc-pascal] Font reading library

2011-04-01 Thread Felipe Monteiro de Carvalho
Hello, I just tought I'd ask: Do we have a Pascal library for reading font files? TTF and other formats. Obtain the information about the font and the glyphs. thanks, -- Felipe Monteiro de Carvalho ___ fpc-pascal maillist -

Re: [fpc-pascal] Font reading library

2011-04-01 Thread Darius Blaszyk
Hi Felipe, Check fp-image. I have also implemented an OpenGL rendering version once if you need it let me know. Regards, Darius On Apr 1, 2011, at 3:18 PM, Felipe Monteiro de Carvalho wrote: Hello, I just tought I'd ask: Do we have a Pascal library for reading font files? TTF and other

Re: [fpc-pascal] Font reading library

2011-04-01 Thread Felipe Monteiro de Carvalho
Hello, Which unit exactly? I know that it has bindings to the freetype library (freetype.pp), but AFAIK that's it. I don't remember that it has Pascal code to read font files, or at least I couldn't find it if it has. -- Felipe Monteiro de Carvalho

Re: [fpc-pascal] Font reading library

2011-04-01 Thread Darius Blaszyk
On Apr 1, 2011, at 3:39 PM, Felipe Monteiro de Carvalho wrote: Hello, Which unit exactly? I know that it has bindings to the freetype library (freetype.pp), but AFAIK that's it. I don't remember that it has Pascal code to read font files, or at least I couldn't find it if it has. So your

Re: Re[6]: [fpc-pascal] TIniFile crash/memory loss

2011-04-01 Thread DaWorm
On Fri, Apr 1, 2011 at 9:09 AM, Bart bartjun...@gmail.com wrote: The test case was an invalid filename.  Is this the primary failure method? This was merely to demonstrate the possibility of the destructor failing. What other things would make the destructor of the TIniFile fail? It seems to

Re: [fpc-pascal] Font reading library

2011-04-01 Thread Darius Blaszyk
As it happens, I stumbled across this one just now. Supposedly this is a native freetype implementation. I did not check it out yet, so if you get to it, please let me know how it works for you. I'm also interested in implementing this for you own library.

Re[8]: [fpc-pascal] TIniFile crash/memory loss

2011-04-01 Thread José Mejuto
Hello FPC-Pascal, Friday, April 1, 2011, 2:45:38 PM, you wrote: D On Fri, Apr 1, 2011 at 6:28 AM, José Mejuto joshy...@gmail.com wrote: An exception in free is an extreme rare condition, but it could happend, and is better that your software stops to work than notify 2 years later that your 2

[fpc-pascal] A warning when Blockwriting/reading dynamic array pointers

2011-04-01 Thread Jürgen Hestermann
I just wanted to post a warning for everybody who wants to (block)write/read dynamic arrays to/from file. All the documentation about dynamic arrays I found only told me what I *can* do with them but none said what I can *not* do. And there was no detailed information about the internal works.

Re: [fpc-pascal] A warning when Blockwriting/reading dynamic array pointers

2011-04-01 Thread Jonas Maebe
On 01 Apr 2011, at 18:04, Jürgen Hestermann wrote: If you Blockwrite a dynamic array pointer to file (i.e. because it is part of a large record) and read it back later with Blockread then the pointer value is invalid of course. BUT, if you now try to set it to nil as in DynArray := nil;

Re: [fpc-pascal] Font reading library

2011-04-01 Thread Michael Van Canneyt
On Fri, 1 Apr 2011, Darius Blaszyk wrote: As it happens, I stumbled across this one just now. Supposedly this is a native freetype implementation. I did not check it out yet, so if you get to it, please let me know how it works for you. I'm also interested in implementing this for you own

Re: [fpc-pascal] A warning when Blockwriting/reading dynamic array pointers

2011-04-01 Thread Jürgen Hestermann
Jonas Maebe schrieb: If you Blockwrite a dynamic array pointer to file (i.e. because it is part of a large record) and read it back later with Blockread then the pointer value is invalid of course. BUT, if you now try to set it to nil as in DynArray := nil; then Free Pascal seems to free

Re: [fpc-pascal] A warning when Blockwriting/reading dynamic array pointers

2011-04-01 Thread Jonas Maebe
On 01 Apr 2011, at 18:44, Jürgen Hestermann wrote: Jonas Maebe schrieb: If you Blockwrite a dynamic array pointer to file (i.e. because it is part of a large record) and read it back later with Blockread then the pointer value is invalid of course. BUT, if you now try to set it to nil

Re: [fpc-pascal] Font reading library

2011-04-01 Thread dhkblaszyk
On Fri, 1 Apr 2011 18:44:02 +0200 (CEST), Michael Van Canneyt mich...@freepascal.org wrote: On Fri, 1 Apr 2011, Darius Blaszyk wrote: As it happens, I stumbled across this one just now. Supposedly this is a native freetype implementation. I did not check it out yet, so if you get to it,

Re: [fpc-pascal] Font reading library

2011-04-01 Thread Helmut Hartl
Am 01.04.11 18:52, schrieb dhkblas...@zeelandnet.nl: On Fri, 1 Apr 2011 18:44:02 +0200 (CEST), Michael Van Canneyt mich...@freepascal.org wrote: On Fri, 1 Apr 2011, Darius Blaszyk wrote: As it happens, I stumbled across this one just now. Supposedly this is a native freetype