[tracker/direct-access: 27/47] libtracker-direct, libtracker-sparql: Make sure Connection is kept alife longer than Cursor
- From: Martyn James Russell <mr src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [tracker/direct-access: 27/47] libtracker-direct, libtracker-sparql: Make sure Connection is kept alife longer than Cursor
- Date: Wed, 14 Jul 2010 16:46:31 +0000 (UTC)
commit 047a9e40c85dc2f9584c2f1c274ddee03e7b0ed9
Author: Philip Van Hoof <philip codeminded be>
Date: Thu Jul 8 13:54:10 2010 +0200
libtracker-direct, libtracker-sparql: Make sure Connection is kept alife longer than Cursor
src/libtracker-direct/tracker-connection.vala | 4 +++-
src/libtracker-sparql/tracker-cursor.vala | 1 +
2 files changed, 4 insertions(+), 1 deletions(-)
---
diff --git a/src/libtracker-direct/tracker-connection.vala b/src/libtracker-direct/tracker-connection.vala
index d68a424..444bb85 100644
--- a/src/libtracker-direct/tracker-connection.vala
+++ b/src/libtracker-direct/tracker-connection.vala
@@ -35,6 +35,8 @@ public class Tracker.Direct.Connection : Tracker.Sparql.Connection {
public override Sparql.Cursor query (string sparql) throws GLib.Error {
var query_object = new Sparql.Query (sparql);
- return query_object.execute_cursor ();
+ var cursor = query_object.execute_cursor ();
+ cursor.connection = this;
+ return cursor;
}
}
diff --git a/src/libtracker-sparql/tracker-cursor.vala b/src/libtracker-sparql/tracker-cursor.vala
index 621e275..f2be6e2 100644
--- a/src/libtracker-sparql/tracker-cursor.vala
+++ b/src/libtracker-sparql/tracker-cursor.vala
@@ -18,6 +18,7 @@
*/
public abstract class Tracker.Sparql.Cursor : Object {
+ public Connection connection { get; set; }
public abstract int n_columns { get; }
public abstract unowned string get_string (int column, out int length = null);
public virtual bool interrupt () throws GLib.Error {
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]