Skip to content

Commit

Permalink
Merge pull request #44 from elektrofuzzis/fix/unsubscribe-only-when-i…
Browse files Browse the repository at this point in the history
…nitialized

Fix: unsubscribe only when initialized
  • Loading branch information
Bloeckchengrafik authored Jan 11, 2024
2 parents 87b9ab2 + 4562570 commit 28e4bdd
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/ftswarm-core/src/SwOSSwarm.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -396,10 +396,11 @@ void SwOSSwarm::halt( void ) {
}

void SwOSSwarm::unsubscribe( void ) {

for (uint8_t i=0; i<=maxCtrl; i++)
Ctrl[i]->unsubscribe( true );

if ( Ctrl[i])
Ctrl[i]->unsubscribe( true );
else
printf("[ERROR]: unsubscribe: Ctrl[%d] is NULL\n", i );
}

uint8_t SwOSSwarm::getIndex( FtSwarmSerialNumber_t serialNumber ) {
Expand Down

0 comments on commit 28e4bdd

Please sign in to comment.