[Digikam-devel] [digikam] [Bug 338176] Face Recognition memory allocation crash application
Gilles Caulier
caulier.gilles at gmail.com
Mon Dec 15 12:54:27 GMT 2014
https://bugs.kde.org/show_bug.cgi?id=338176
--- Comment #29 from Gilles Caulier <caulier.gilles at gmail.com> ---
Git commit 59f0bdb6b2709171354418ed297d4aa1d667ebad by Marcel Wiesweg.
Committed on 15/11/2014 at 13:47.
Pushed by mwiesweg into branch 'master'.
Add database cleanup calls to have a clean shutdown of SQLite data at
application termination
M +3 -0 app/main/main.cpp
M +17 -3 tests/testdatabase.cpp
http://commits.kde.org/digikam/59f0bdb6b2709171354418ed297d4aa1d667ebad
diff --git a/app/main/main.cpp b/app/main/main.cpp
index 3564d23..85fcbc7 100644
--- a/app/main/main.cpp
+++ b/app/main/main.cpp
@@ -62,6 +62,7 @@
#include "databaseparameters.h"
#include "digikamapp.h"
#include "scancontroller.h"
+#include "thumbnaildatabaseaccess.h"
#include "version.h"
using namespace Digikam;
@@ -235,6 +236,8 @@ int main(int argc, char* argv[])
int ret = app.exec();
+ DatabaseAccess::cleanUpDatabase();
+ ThumbnailDatabaseAccess::cleanUpDatabase();
KExiv2Iface::KExiv2::cleanupExiv2();
return ret;
diff --git a/tests/testdatabase.cpp b/tests/testdatabase.cpp
index 10c14ad..0930029 100644
--- a/tests/testdatabase.cpp
+++ b/tests/testdatabase.cpp
@@ -30,6 +30,7 @@
#include <QSqlDatabase>
#include <QDBusConnection>
#include <QString>
+#include <QTimer>
// KDE includes
@@ -47,6 +48,7 @@
#include "databaseparameters.h"
#include "scancontroller.h"
#include "setup.h"
+#include "thumbnaildatabaseaccess.h"
#include "version.h"
namespace Digikam
@@ -76,16 +78,28 @@ int main(int argc, char** argv)
KCmdLineArgs::init(argc, argv, &aboutData);
KApplication app;
- DatabaseParameters params =
DatabaseParameters::parametersFromConfig(KGlobal::config());
+ DatabaseParameters params;
+ params.databaseType = DatabaseParameters::SQLiteDatabaseType();
+ params.setDatabasePath(QDir::currentPath() + "/digikam-test.db");
+ params.setThumbsDatabasePath(QDir::currentPath() +
"/digikam-thumbs-test.db");
+
params.legacyAndDefaultChecks();
QDBusConnection::sessionBus().registerService("org.kde.digikam.startup-" +
QString::number(QCoreApplication::instance()->applicationPid()));
// initialize database
- bool b = AlbumManager::instance()->setDatabase(params, false);
+ bool b = AlbumManager::instance()->setDatabase(params, false,
"/media/fotos/Digikam Sample/");
kDebug() << "Database initialization done: " << b;
-
+
+ QTimer::singleShot(500, &app, SLOT(quit()));
+ app.exec();
+
+ ScanController::instance()->shutDown();
+
+ DatabaseAccess::cleanUpDatabase();
+ ThumbnailDatabaseAccess::cleanUpDatabase();
+
return 0;
}
--
You are receiving this mail because:
You are the assignee for the bug.
More information about the Digikam-devel
mailing list