From 9fcba2eb138ce59e26eaa28494f8ebc4c9cdb3ba Mon Sep 17 00:00:00 2001 From: Paul Hollinsky Date: Fri, 28 Feb 2020 19:57:43 -0500 Subject: [PATCH] Notify extensions we're going offline before we actually do --- device/device.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/device/device.cpp b/device/device.cpp index 54e334b..2a2ec6c 100644 --- a/device/device.cpp +++ b/device/device.cpp @@ -250,6 +250,8 @@ bool Device::goOnline() { } bool Device::goOffline() { + forEachExtension([](const std::shared_ptr& 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& ext) { ext->onGoOffline(); return true; }); return true; }