[tracker/direct-access: 97/121] libtracker-direct: Fix warning on clean-up after failed initialization
- From: Jürg Billeter <juergbi src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [tracker/direct-access: 97/121] libtracker-direct: Fix warning on clean-up after failed initialization
- Date: Thu, 22 Jul 2010 14:52:00 +0000 (UTC)
commit ca4246b5cc88491f3e88b8bec6900d7bf6daf816
Author: Jürg Billeter <j bitron ch>
Date: Thu Jul 22 11:06:27 2010 +0200
libtracker-direct: Fix warning on clean-up after failed initialization
src/libtracker-direct/tracker-direct.vala | 8 +++++---
1 files changed, 5 insertions(+), 3 deletions(-)
---
diff --git a/src/libtracker-direct/tracker-direct.vala b/src/libtracker-direct/tracker-direct.vala
index d1cd63e..1141af3 100644
--- a/src/libtracker-direct/tracker-direct.vala
+++ b/src/libtracker-direct/tracker-direct.vala
@@ -23,16 +23,18 @@ public class Tracker.Direct.Connection : Tracker.Sparql.Connection {
public Connection () throws Sparql.Error
requires (!initialized) {
- initialized = true;
if (!Data.Manager.init (DBManagerFlags.READONLY, null, null, false, null, null)) {
throw new Sparql.Error.INTERNAL ("Unable to initialize database");
}
+ initialized = true;
}
~Connection () {
// Clean up connection
- Data.Manager.shutdown ();
- initialized = false;
+ if (initialized) {
+ Data.Manager.shutdown ();
+ initialized = false;
+ }
}
public override Sparql.Cursor? query (string sparql, Cancellable? cancellable) throws Sparql.Error {
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]