Home Comments

Who's Counting? Sample code errors?

blairblair Member Blair ZajacOrganization: Sony Pictures ImageworksProject: VnP ✭✭
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

Comments

  • michimichi Member Michi HenningOrganization: Triodia TechnologiesProject: I have a passing interest in Ice :-) ✭✭✭
    Urgh, blush--cut and paste error...

    Thanks for letting me know, I'll fix this ASAP!

    Cheers,

    Michi.
  • michimichi Member Michi HenningOrganization: Triodia TechnologiesProject: I have a passing interest in Ice :-) ✭✭✭
    We've put an updated version on our web server. Thanks for letting us know about the bug!

    Cheers,

    Michi.
Sign In or Register to comment.