From a3d54ec4c28be879ec5b56da4ac67147bb6a3225 Mon Sep 17 00:00:00 2001 From: Wenzel Jakob Date: Mon, 20 Apr 2015 14:40:57 +0200 Subject: [PATCH] removed incorrect usage of std::erase (reported by Brooks Moses) --- src/libhw/device.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/libhw/device.cpp b/src/libhw/device.cpp index 21c65a5b..ea9f46b5 100644 --- a/src/libhw/device.cpp +++ b/src/libhw/device.cpp @@ -142,7 +142,10 @@ void Device::init(Device *other) { void Device::shutdown() { Assert(m_initialized); - std::remove(m_session->m_devices.begin(), m_session->m_devices.end(), this); + m_session->m_devices.erase( + std::remove(m_session->m_devices.begin(), m_session->m_devices.end(), this), + m_session->m_devices.end() + ); } void Device::addCallback(DeviceEventListener *callback) {