diff options
author | Janek Bevendorff <janek@jbev.net> | 2019-11-08 15:34:40 +0300 |
---|---|---|
committer | Janek Bevendorff <janek@jbev.net> | 2019-11-09 13:33:32 +0300 |
commit | 22af66e3b586583b2d8493b524accfc546cddf32 (patch) | |
tree | a6549c318de72b75c18069ec67092db1d154e477 /src/gui/DatabaseWidget.cpp | |
parent | 87ca7c7f7b84c361a00ee892232b139d60241d16 (diff) |
Ensure database contents are released right away.
When we lock a database, we reset the database pointer to
free its resources. Since various other widgets besides the
DatabaseWidget hold references to the shared pointer object,
however, it cannot be guaranteed that the actual database
object will be freed right away. This patch adds a releaseData()
method which is called upon database lock to ensure all
residual data is cleared without having to rely on the actual
database object being cleaned up.
Diffstat (limited to 'src/gui/DatabaseWidget.cpp')
-rw-r--r-- | src/gui/DatabaseWidget.cpp | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/src/gui/DatabaseWidget.cpp b/src/gui/DatabaseWidget.cpp index 54f2a2f47..29942571c 100644 --- a/src/gui/DatabaseWidget.cpp +++ b/src/gui/DatabaseWidget.cpp @@ -418,6 +418,8 @@ void DatabaseWidget::replaceDatabase(QSharedPointer<Database> db) // Keep the instance active till the end of this function Q_UNUSED(oldDb); #endif + + oldDb->releaseData(); } void DatabaseWidget::cloneEntry() |