Notify extensions we're going offline before we actually do

pull/25/head
Paul Hollinsky 2020-02-28 19:57:43 -05:00
parent 0c330f734b
commit 9fcba2eb13
1 changed files with 2 additions and 1 deletions

View File

@ -250,6 +250,8 @@ bool Device::goOnline() {
}
bool Device::goOffline() {
forEachExtension([](const std::shared_ptr<DeviceExtension>& ext) { ext->onGoOffline(); return true; });
if(!com->sendCommand(Command::EnableNetworkCommunication, false))
return false;
@ -275,7 +277,6 @@ bool Device::goOffline() {
online = false;
forEachExtension([](const std::shared_ptr<DeviceExtension>& ext) { ext->onGoOffline(); return true; });
return true;
}