I've posted the code for the simple test application previously, but can provide if necessary.

I've posted the code for the simple test application previously, but can provide if necessary. Basically a function in a DYLIB is passed a string parameter, it returns TRUE with an OUT variable of another string which proves that the data went into the DYLIB function and returned out. The function template:

function _say_Hello(Hello: string; out ReturnString: string): boolean; cdecl; external TestDLL;

I have simple showmessage() statements in the calling application for things like onCloseQuery and onClose etc, these all show, everything WORKS as it should until the application closes(onCloseQuery executed, onClose executed, and about half a second to a second after everything shuts down the problem report pops up). I've put the google drive link to the error log. Basically I get this:

Crashed Thread: 0 Dispatch queue: com.apple.main-thread

Exception Type: EXC_BAD_ACCESS (SIGSEGV)
Exception Codes: KERN_PROTECTION_FAILURE at 0x00000000bf7ffffc
Exception Note: EXC_CORPSE_NOTIFY

Termination Signal: Segmentation fault: 11
Termination Reason: Namespace SIGNAL, Code 0xb
Terminating Process: exc handler [0]

When I look at the stack trace (attached), there are none of my two files (DylibTest and libpTesDLL.DYLIB) mentioned, it's all RTL/system units. I've googled Seg Fault 11, but nothing jumps out.

EDIT: Added an Initialisation and Finalization section to the unit of the calling program. Initialisation is processed, Finalization is not processed (although both are processed in the Win32 version).

Any ideas appreciated......
https://drive.google.com/a/orexresearch.com/file/d/1wzVGrVbimjyZPfat3S-sZeBajqkKosCG/view?usp=drive_web

Comments