c678cae498
Discussion thread: http://en.sfml-dev.org/forums/index.php?topic=20875.0 Basically, the issue with sf::Image::create was, that it would either occupy space, it doesn't need, because std::vector::resize doesn't actually shrink the vector, or reallocate in an inefficient way by needlessly copying the whole old image over. Neither did it grant strong exception safety guarantee because it changed the non-throwing members (m_size) prior to doing the critical stuff (reallocating) which may throw. Changing the order and using a temporary (create-temporary-and-swap idiom; see http://www.gotw.ca/gotw/059.htm) fixes both of these problems. |
||
---|---|---|
.. | ||
SFML |