aldebaran / libqi

NAOqi core framework
http://doc.aldebaran.com/libqi/
BSD 3-Clause "New" or "Revised" License
66 stars 53 forks source link

Possible bug in version 2.4... #12

Closed rlyle closed 3 years ago

rlyle commented 8 years ago

So I was cleaning up all the warnings in release 2.4 and ran across the following warning: 1>c:\work\ibm\self\lib\libqi\src\type\anyreference.cpp(404): warning C4800: 'unsigned int': forcing value to bool 'true' or 'false' (performance warning)

Looking at the code, there seems to be an error here on this line: mustDestroy.assign(false, mustDestroy.size());

In std::vector::assign, the first argument is the size, the 2nd argument is the value to assign into the vector. I think the author intended to do this instead:

  mustDestroy.assign( mustDestroy.size(), false );

This does fix the warning... However, I'm unsure about the intent .. do we want the Cleanup() object to delete the objects or not.