Cocoa interface added to dylib causes runtime error on app exit
Original Reporter info from Mantis: tk
-
Reporter name: TK
Original Reporter info from Mantis: tk
- Reporter name: TK
Description:
When Interfaces unit is added to any dylib and Cocoa widgetset is selected (any bitness) the app loads, unloads and uses the dylib correctly.
But then on app exit there is always 216 runtime error.
Steps to reproduce:
Compile the attached demo (main app + dylib) and test.
Additional information:
FPC version I use is 3.2.
I have no idea what is the cause.
The error comes after final 'end.' and even after all unit finalizations.
When looking deeper into Assembler window it occurs in fpc_do_exit on this line:
00000001000162F2 e889a90000 callq 0x100020c80 &LtPos;SYSTEM_$$_SYSTEM_EXIT>
Error output from debugger shell:
objc[8701]: autorelease pool page 0x7fddf4088000 corrupted
magic 0x00000000 0x30000000 0x00000000 0x30000000
should be 0xa1a1a1a1 0x4f545541 0x454c4552 0x21455341
pthread 0x7fff7a2bc000
should be 0x7fff7a2bc000
An unhandled exception occurred at $00007FFF91C6702F:
EAccessViolation:
$00007FFF91C6702F
$00007FFF91C6717F
$00007FFF91C722D7
$00007FFF91C5A9A4
$00007FFF9C289BC2
$00007FFF8E92A8D5
$000000010B9F9D2F
$000000010B9FA474
$000000010B883E03
$000000010B896DC9
$000000010B888183
$00007FFF61F3018B
$00007FFF86431463
$00007FFF86431767
Mantis conversion info:
- Mantis ID: 36360
- Build: 62230M
- Version: 2.1 (SVN)
- Fixed in revision: 62352 (#62ef41f7)