On 10 Dec 2005, at 22:55, L505 wrote:

The DLL does not know what your EXE memory is doing. So by the time the string gets to the DLL it may be cleaned up and gone, kind of like a garbage collector. Same
thing with returning a string..

This does not make sense to me. When you return a string (from a function in a dll or anywhere else), this string will have a reference count of at least 1 and thus will not be cleaned up by anyone.

The only problem I can see that can occur is in case the program and the dll indeed use different memory managers, in which case you can have a situation where memory allocated by the dll's memory manager is freed "to" the program's memory manager, and that will probably confuse the hell out of it (even if they are essentially the same memory manager, just using different data structures).


Jonas

_______________________________________________
fpc-devel maillist  -  fpc-devel@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-devel

Reply via email to