diff --git a/wrappers/cpp/libfreenect.hpp b/wrappers/cpp/libfreenect.hpp index 98dc0082..631fb959 100644 --- a/wrappers/cpp/libfreenect.hpp +++ b/wrappers/cpp/libfreenect.hpp @@ -199,7 +199,7 @@ namespace Freenect { DeviceMap::iterator it = m_devices.find(_index); if (it != m_devices.end()) delete it->second; ConcreteDevice * device = new ConcreteDevice(m_ctx, _index); - m_devices.insert(std::make_pair(_index, device)); + m_devices[_index] = device; return *device; } void deleteDevice(int _index) {