File tree Expand file tree Collapse file tree 2 files changed +17
-1
lines changed Expand file tree Collapse file tree 2 files changed +17
-1
lines changed Original file line number Diff line number Diff line change @@ -338,6 +338,7 @@ class SonicPiAPI
338
338
std::shared_ptr<kissnet::tcp_socket> m_bootDaemonSock;
339
339
340
340
std::mutex m_osc_mtx;
341
+ bool m_shutdown_engaged = false ;
341
342
LogOption m_logOption;
342
343
343
344
Original file line number Diff line number Diff line change @@ -302,9 +302,24 @@ SonicPiAPI::~SonicPiAPI()
302
302
303
303
void SonicPiAPI::Shutdown ()
304
304
{
305
- LOG (INFO, " Shutdown" );
305
+ if (m_shutdown_engaged)
306
+ {
307
+ LOG (INFO, " Shutdown already initiated..." );
308
+ return ;
309
+ }
310
+
311
+ LOG (INFO, " Initiating Shutdown" );
312
+
306
313
std::lock_guard<std::mutex> lg (m_osc_mtx);
307
314
315
+ if (m_shutdown_engaged)
316
+ {
317
+ LOG (INFO, " Shutdown already initiated.." );
318
+ return ;
319
+ }
320
+
321
+ m_shutdown_engaged = true ;
322
+
308
323
switch (m_state)
309
324
{
310
325
case State::Reset :
You can’t perform that action at this time.
0 commit comments