diff options
Diffstat (limited to 'typesystem.cpp')
-rw-r--r-- | typesystem.cpp | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/typesystem.cpp b/typesystem.cpp index 4b32b965f..ae5c3a1c8 100644 --- a/typesystem.cpp +++ b/typesystem.cpp @@ -1591,9 +1591,14 @@ bool Handler::startElement(const QString &, const QString &n, return true; } -TypeDatabase *TypeDatabase::instance() +TypeDatabase *TypeDatabase::instance(bool newInstance) { - static TypeDatabase *db = new TypeDatabase(); + static TypeDatabase *db = 0; + if (!db || newInstance) { + if (db) + delete db; + db = new TypeDatabase; + } return db; } |