[vw7.9][COM] Comment contradictory about reference counting on temporary interface pointers

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

[vw7.9][COM] Comment contradictory about reference counting on temporary interface pointers

Thomas Brodt-2
Until 7.8.1, temporary interface pointers were not reference counted, as it is stated in the comment of method #forTemporaryInterfacePointerAtAddress:

"Answer a new instance of the receiver for an external interface pointer whose pointer value is in external memory referenced by <anExternalAddress>.  This creation service is used to instantiate interfaces which are temporarily owned - the interface instance is not separately reference counted and should not be released by the caller.  E.g., this is always used by the callee during interface function invocation to access an interface argument provided by an external caller.  The caller must explicitly make a copy of the interface and increment its reference count if it holds on to this interface reference. "

this method however calls #newTemporaryInterfacePointerAtAddress: and there it says:

    " Answer a new instance of the receiver for an interface whose pointer value is in external memory referenced by <anExternalAddress>. In earlier versions of COM connect, this interface pointer was not referencecounted. From 7.9 on,
    it is at it may be kept by the server object."


1) I think the comments should be unambiguous about the fact of reference counting.

2) Another question is why *temporary* interface pointers are suddenly all made reference counted just in case some one holds onto them. The comment above explicitely said that if you hold on to the interface, you should copy your own and reference counted interface pointer.

Thomas

_______________________________________________
vwnc mailing list
[hidden email]
http://lists.cs.uiuc.edu/mailman/listinfo/vwnc
Reply | Threaded
Open this post in threaded view
|

Re: [vw7.9][COM] Comment contradictory about reference counting on temporary interface pointers

Alexander Augustin
Hello Thomas,

many thanks for the hint.
There were implementation changes which also caused the comment change in #newTemporaryInterfacePointerAtAddress:.
The method  #forTemporaryInterfacePointerAtAddress: seemingly was not touched during development and its comment
needs to be updated.

I will look after this.

The reason for the change is that COM Connect 7.9 does automatic reference counting while preserving backwards compatibility.
(More details about the changes to COM Connect can be found in the release notes).

Best regards,
Alex
--

Alexander Augustin (Dipl.-Informatiker),
Email:
[hidden email] ,
Tel: +49-3496-214329, Fax: +49-3496-214712
Georg Heeg eK, Köthen
Handelsregister: Amtsgericht Dortmund A 12812



Am 26.07.2012 11:45, schrieb Thomas Brodt:
Until 7.8.1, temporary interface pointers were not reference counted, as it is stated in the comment of method #forTemporaryInterfacePointerAtAddress:

"Answer a new instance of the receiver for an external interface pointer whose pointer value is in external memory referenced by <anExternalAddress>.  This creation service is used to instantiate interfaces which are temporarily owned - the interface instance is not separately reference counted and should not be released by the caller.  E.g., this is always used by the callee during interface function invocation to access an interface argument provided by an external caller.  The caller must explicitly make a copy of the interface and increment its reference count if it holds on to this interface reference. "

this method however calls #newTemporaryInterfacePointerAtAddress: and there it says:

    " Answer a new instance of the receiver for an interface whose pointer value is in external memory referenced by <anExternalAddress>. In earlier versions of COM connect, this interface pointer was not referencecounted. From 7.9 on,
    it is at it may be kept by the server object."


1) I think the comments should be unambiguous about the fact of reference counting.

2) Another question is why *temporary* interface pointers are suddenly all made reference counted just in case some one holds onto them. The comment above explicitely said that if you hold on to the interface, you should copy your own and reference counted interface pointer.

Thomas


_______________________________________________
vwnc mailing list
[hidden email]
http://lists.cs.uiuc.edu/mailman/listinfo/vwnc


--
Alexander Augustin (Dipl

Alexander Augustin (Dipl.-Informatiker),
Email:
[hidden email] ,
Tel: +49-3496-214329, Fax: +49-3496-214712
Georg Heeg eK, Köthen
Handelsregister: Amtsgericht Dortmund A 12812


_______________________________________________
vwnc mailing list
[hidden email]
http://lists.cs.uiuc.edu/mailman/listinfo/vwnc