Skip to content

Commit

Permalink
erase flagtype from FlagMap when destroyed
Browse files Browse the repository at this point in the history
  • Loading branch information
atupone committed Apr 13, 2024
1 parent 7049185 commit 4d89ea9
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
2 changes: 2 additions & 0 deletions include/Flag.h
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,8 @@ class FlagType
getFlagMap()[flagAbbv] = this;
}

~FlagType();

/** returns a label of flag name and abbreviation with the flag name
* excentuating the abbreviation if relevant.
*/
Expand Down
5 changes: 5 additions & 0 deletions src/common/Flag.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -250,6 +250,11 @@ void clearCustomFlags()
}
}

FlagType::~FlagType()
{
getFlagMap().erase(flagAbbv);
}

void* FlagType::pack(void* buf) const
{
buf = nboPackUByte(buf, (flagAbbv.size() > 0) ? flagAbbv[0] : 0);
Expand Down

0 comments on commit 4d89ea9

Please sign in to comment.