In Free Pascal, the type of interface is mode-specific. Basically, there is COM or CORBA mode. COM is by default and roughly compatible with Delphi. CORBA is a simpler case without reference counting. (and therefore also does not generate calls for recounting functions). So basically the FPC Corba interface is similar to the hypothetical ancestor of the IUnknown interface.
In addition, sometimes there are some differences when releasing interfaces. Delphi tends to save by reducing the recount at the end of the procedure or block (in larger procedures), while the FPC, as you know, releases them early, as a rule, immediately after the approval of the last use. Both variants are logical variants of btw implementation, the basis for which is used in the field of temporary variables. (only at the function level, as well as in deeper nested blocks)
However, this sometimes reveals hidden (bad) assumptions in the code, especially when using interface references and object references within the same procedure, which can survive in Delphi, but not in FPC. This is a typical case, which shows that long-term working code is not necessarily correct. You can only notice hidden assumptions when changing the implementation.
(added later :) note that you can use the COM style on * nix. Basically, it is the insertion of calls into reference counting procedures, which establish two types of interface. Not which system (COM, Corba, or just RTL reference counting) these calls are routed.
Note that I think the COM names for Corba for both interface types were poorly selected. Corba's interfaces are actually recalculated, but traditionally this recalculation is processed manually, since Java does not support automatic interfaces processed externally.
source share