[fpc-pascal] Interface, _AddRef, _Release, etc.
Graeme Geldenhuys
graemeg.lists at gmail.com
Fri Sep 16 09:46:35 CEST 2011
You're original problem is exactly why I said mixing class instances and
interface instance is looking for trouble. You better know what you are
doing.
Attached are two examples of your program. One using CORBA interfaces,
the other using non-reference counting COM style interface. Both work
under 64-bit FPC 2.4.5 under Linux.
[tmp]$ ./testme
foo
Done
Heap dump by heaptrc unit
20 memory blocks allocated : 599/616
20 memory blocks freed : 599/616
0 unfreed memory blocks : 0
True heap size : 131072
True free heap : 131072
[tmp]$ ./testme_corba
foo
Done
Heap dump by heaptrc unit
20 memory blocks allocated : 599/616
20 memory blocks freed : 599/616
0 unfreed memory blocks : 0
True heap size : 131072
True free heap : 131072
Regards,
- Graeme -
--
fpGUI Toolkit - a cross-platform GUI toolkit using Free Pascal
http://fpgui.sourceforge.net/
-------------- next part --------------
A non-text attachment was scrubbed...
Name: testme.pas
Type: text/x-pascal
Size: 1431 bytes
Desc: not available
URL: <http://lists.freepascal.org/pipermail/fpc-pascal/attachments/20110916/a6c87ac8/attachment.pas>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: testme_corba.pas
Type: text/x-pascal
Size: 819 bytes
Desc: not available
URL: <http://lists.freepascal.org/pipermail/fpc-pascal/attachments/20110916/a6c87ac8/attachment-0001.pas>
More information about the fpc-pascal
mailing list