summaryrefslogtreecommitdiff
path: root/src/categories.cpp
diff options
context:
space:
mode:
authorTannin <devnull@localhost>2014-04-05 15:36:42 +0200
committerTannin <devnull@localhost>2014-04-05 15:36:42 +0200
commitcabed9b268c9f095d5e3b98a6797b0bcdcd38b1f (patch)
tree454b03b0c5664e90fe586e7b39603e34a526d35b /src/categories.cpp
parent98e5e57a845541acddf519a81957261f58008cb9 (diff)
parentc017f4a0d50b67a44e276bd5ae8929ed3990c62c (diff)
Merge with branch1.1
Diffstat (limited to 'src/categories.cpp')
-rw-r--r--src/categories.cpp8
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()
{