1
0
Fork 0

delete the universe before removing the number from the map

This commit is contained in:
Kevin Matz 2021-06-22 21:25:40 -04:00
parent 84476d33c7
commit 32ef49554b
1 changed files with 4 additions and 2 deletions

View File

@ -45,8 +45,10 @@ void Receiver::subscribe(const uint16_t num) {
}
void Receiver::unsubscribe(const uint16_t num) {
if (universes_.count(num))
universes_.erase(num);
if (!universes_.count(num))
return;
delete universes_.at(num);
universes_.erase(num);
}
Universe * Receiver::universe(const uint16_t universe) {