Archived
This forum has been archived. Please start a new discussion on GitHub.
Who's Counting? Sample code errors?
Reading the new Connections article Who's Counting?, there appears to
be some coding errors in the IceInternal::Handle class on page 12.
The method
Handle& operator=(const Handle& h)
never calls __incRef() on h->_p, instead it calls __incRef() on _p and
then __decRef() on the original _p (now named ptr).
and
Handle& operator=(T* p)
refers to the h variable, which is not in scope in this method.
Regards,
Blair
be some coding errors in the IceInternal::Handle class on page 12.
The method
Handle& operator=(const Handle& h)
never calls __incRef() on h->_p, instead it calls __incRef() on _p and
then __decRef() on the original _p (now named ptr).
and
Handle& operator=(T* p)
refers to the h variable, which is not in scope in this method.
Regards,
Blair
0
Comments
-
Urgh, blush--cut and paste error...
Thanks for letting me know, I'll fix this ASAP!
Cheers,
Michi.0 -
We've put an updated version on our web server. Thanks for letting us know about the bug!
Cheers,
Michi.0