diff options
Diffstat (limited to 'src/categories.cpp')
| -rw-r--r-- | src/categories.cpp | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/categories.cpp b/src/categories.cpp index 62ba3ca5..27720829 100644 --- a/src/categories.cpp +++ b/src/categories.cpp @@ -43,6 +43,7 @@ QString CategoryFactory::categoriesFilePath() CategoryFactory::CategoryFactory() { + atexit(&cleanup); reset(); QFile categoryFile(categoriesFilePath()); @@ -102,6 +103,7 @@ CategoryFactory &CategoryFactory::instance() void CategoryFactory::reset() { m_Categories.clear(); + m_IDMap.clear(); addCategory(0, "None", MakeVector<int>(2, 28, 87), 0); } @@ -124,6 +126,12 @@ void CategoryFactory::setParents() } } +void CategoryFactory::cleanup() +{ + delete s_Instance; + s_Instance = NULL; +} + void CategoryFactory::saveCategories() { |
