Fix inconsistencies between construction, copy construction and reference counting of GenericAddress (IOpaqueAddress)
The following discussion from !1166 (merged) should be addressed:
-
@clemenci started a discussion: This is strictly backward compatible, as it makes explicit what was done implicitly by the compiler, but I do not think it is correct, as the copy constructor is not copying all members.
OTOH I'm not convinced that the copy constructor is correct either: it leaves the reference count at 0, which is not correct... and it's not correct in the normal constructor, as calling
release()
on a newly constructedGenericAddress
does not delete the instance as it should (unlessaddRef()
is magically called).To summarize, this change is fair, but the starting point is wrong, so I'll merge (after testing in LHCb) and I'll create an issue to address the inconsistencies.