|Subject||RE: [firebird-support] *** possible bug in FB 2.5.2 supperclassic with UDF *** solved|
Hello, there is an excellent article about UDFs and memory management: http://www.ibphoenix.com/resources/documents/how_to/doc_307
Very glad you solved this problem with my tip =)
Also, there are more pitfalls when building a UDF using Delphi (maybe another languages too). I agree with you that this must be added to Firebird's FAQ, maybe with a link to some document explain all pitfalls.
2013/11/28 ICAMSoft <icamsoft@...>
Thanks for anybody who replied and
again my apology for the easiness i charged firebird for the problem...
The problem's reason and the solution for any who may concern:
As some of repliers said the problem was in memory management of delphi under concurrent threads.
After 15 years using delphi, i discovered by googling the variable IsMultiThread
Adding in initialization section the following line
everything is ok, also using superclassic (at least in my machine).
PS1: <IsMultiThread :=true> is silently done by Delphi itself, if threads exist in the uses list. Bad for me, my functions where pretty simple and so threads unit was not declared in uses.
PS2: I think that this could be a major trap for many delphi programmers and that a relative note in documentation about UDF with Delphi in http://www.firebirdfaq.org/faq83/ should be added