[tracker/direct-access: 26/38] 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: 26/38] libtracker-direct: Fix warning on clean-up after failed initialization
- Date: Fri, 13 Aug 2010 15:53:43 +0000 (UTC)
commit e9a902e09c9e721418d4f811603f643dda783f50
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]