From: Owen Smith Date: Thu, 19 Jul 2018 11:55:31 +0000 (+0100) Subject: Call OnDeviceRemoved callback(s) during DeviceList.Stop() X-Git-Tag: 9.0.0-rc1~16 X-Git-Url: http://xenbits.xensource.com/gitweb?a=commitdiff_plain;h=7200b784f052f46e3b0d8321b7b5d192056ef773;p=pvdrivers%2Fwin%2Fxeniface.git Call OnDeviceRemoved callback(s) during DeviceList.Stop() OnDeviceAdded is called for every pre-attached device during DeviceList.Start(), the corresponding call to OnDeviceRemoved should be called for each attached device during the DeviceList.Stop() call. By calling the OnDeviceRemoved callback during the service stop, the xenagent service can remove the "feature-[poweroff|reboot|s3|s4]" flags. Signed-off-by: Owen Smith --- diff --git a/src/xenagent/devicelist.cpp b/src/xenagent/devicelist.cpp index b40b252..e0583f9 100644 --- a/src/xenagent/devicelist.cpp +++ b/src/xenagent/devicelist.cpp @@ -218,6 +218,8 @@ void CDeviceList::Stop() for (DeviceMap::iterator it = m_devs.begin(); it != m_devs.end(); ++it) { + if (m_impl) + m_impl->OnDeviceRemoved(it->second); delete it->second; } m_devs.clear();