diff options
author | Andreas Stöckel <astoecke@techfak.uni-bielefeld.de> | 2015-03-02 00:35:36 +0100 |
---|---|---|
committer | Andreas Stöckel <astoecke@techfak.uni-bielefeld.de> | 2015-03-02 00:35:36 +0100 |
commit | 231f426708babe0964495ac28a54f0f2835c084a (patch) | |
tree | 7775548db606cd1a6a2f1776f92ae8551fc6204b /src/core/parser/stack/TokenRegistry.cpp | |
parent | 596fdab71b8bd116e20e33647d68f1d7a567696e (diff) |
Unregistering all registered tokens when TokenRegistry is destroyed
Diffstat (limited to 'src/core/parser/stack/TokenRegistry.cpp')
-rw-r--r-- | src/core/parser/stack/TokenRegistry.cpp | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/core/parser/stack/TokenRegistry.cpp b/src/core/parser/stack/TokenRegistry.cpp index 21ae109..c135b98 100644 --- a/src/core/parser/stack/TokenRegistry.cpp +++ b/src/core/parser/stack/TokenRegistry.cpp @@ -16,11 +16,19 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. */ +#include "Callbacks.hpp" #include "TokenRegistry.hpp" namespace ousia { namespace parser_stack { +TokenRegistry::~TokenRegistry() +{ + for (const auto &tid: tokenIds) { + parser.unregisterToken(tid.first); + } +} + TokenId TokenRegistry::registerToken(const std::string &token) { // Check whether the given token is already registered |