[folks] EdsTest.Backend: clear up more thoroughly after tests
- From: Simon McVittie <smcv src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [folks] EdsTest.Backend: clear up more thoroughly after tests
- Date: Wed, 20 Mar 2013 13:38:24 +0000 (UTC)
commit ae98b4fae6199b19cabc30a068ada9a8920cbdc5
Author: Simon McVittie <simon mcvittie collabora co uk>
Date: Tue Mar 19 14:22:04 2013 +0000
EdsTest.Backend: clear up more thoroughly after tests
Bug https://bugzilla.gnome.org/show_bug.cgi?id=690830
Reviewed-by: Philip Withnall <philip tecnocode co uk>
[redundant line removed in response to review -smcv]
Signed-off-by: Simon McVittie <simon mcvittie collabora co uk>
tests/lib/eds/backend.vala | 12 +++++++-----
1 files changed, 7 insertions(+), 5 deletions(-)
---
diff --git a/tests/lib/eds/backend.vala b/tests/lib/eds/backend.vala
index 56626ae..781c91b 100644
--- a/tests/lib/eds/backend.vala
+++ b/tests/lib/eds/backend.vala
@@ -41,7 +41,7 @@ public class EdsTest.Backend
private E.BookClient? _addressbook = null;
private GLib.List<string> _e_contacts;
private GLib.List<Gee.HashMap<string, Value?>> _contacts;
- E.SourceRegistry _source_registry;
+ E.SourceRegistry? _source_registry = null;
E.Source? _source = null;
File? _source_file = null;
@@ -162,8 +162,9 @@ public class EdsTest.Backend
"BackendName=local\n").printf (this._addressbook_name);
/* Build a SourceRegistry to manage the sources. */
- this._source_registry = yield create_source_registry (null);
- var signal_id = this._source_registry.source_added.connect ((r, s) =>
+ var source_registry = yield create_source_registry (null);
+ this._source_registry = source_registry;
+ var signal_id = source_registry.source_added.connect ((r, s) =>
{
this._source = s;
this._prepare_source_async.callback ();
@@ -172,7 +173,7 @@ public class EdsTest.Backend
/* Perform the write and then wait for the SourceRegistry to notify. */
yield source_file.replace_contents_async (source_file_content.data, null,
false, FileCreateFlags.NONE, null, null);
- this._source = this._source_registry.ref_source (this._addressbook_name);
+ this._source = source_registry.ref_source (this._addressbook_name);
if (this._source == null)
{
yield;
@@ -180,7 +181,7 @@ public class EdsTest.Backend
/* Sanity check then tidy up. */
assert (this._source != null);
- this._source_registry.disconnect (signal_id);
+ source_registry.disconnect (signal_id);
this._source_file = source_file;
@@ -343,6 +344,7 @@ public class EdsTest.Backend
this._source_file = null;
this._source = null;
this._addressbook = null;
+ this._source_registry = null;
}
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]