summaryrefslogtreecommitdiff
path: root/src/core/parser/stack/TokenRegistry.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/core/parser/stack/TokenRegistry.cpp')
-rw-r--r--src/core/parser/stack/TokenRegistry.cpp8
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