[tracker] libtracker-data: Keep interface ref during close()
- From: Carlos Garnacho <carlosg src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [tracker] libtracker-data: Keep interface ref during close()
- Date: Mon, 28 Nov 2016 01:01:06 +0000 (UTC)
commit 20d80abf54d29e2e74d772dd2af49e8be01bd3ff
Author: Carlos Garnacho <carlosg gnome org>
Date: Sun Nov 27 19:47:41 2016 +0100
libtracker-data: Keep interface ref during close()
The cursor may tear down the last interface instance, which
leads to invalid writes when poking its memory during unlock.
src/libtracker-data/tracker-db-interface-sqlite.c | 4 ++++
1 files changed, 4 insertions(+), 0 deletions(-)
---
diff --git a/src/libtracker-data/tracker-db-interface-sqlite.c
b/src/libtracker-data/tracker-db-interface-sqlite.c
index cb4f503..df30a21 100644
--- a/src/libtracker-data/tracker-db-interface-sqlite.c
+++ b/src/libtracker-data/tracker-db-interface-sqlite.c
@@ -2428,11 +2428,15 @@ tracker_db_cursor_close (TrackerDBCursor *cursor)
}
iface = cursor->ref_stmt->db_interface;
+
+ g_object_ref (iface);
g_atomic_int_add (&iface->n_active_cursors, -1);
tracker_db_interface_lock (iface);
g_clear_pointer (&cursor->ref_stmt, tracker_db_statement_sqlite_release);
tracker_db_interface_unlock (iface);
+
+ g_object_unref (iface);
}
static void
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]