in a single run
* Bug 663889 — crash due to NameDetails which fail to guarantee
non-null full-name/nickname
+* Bug 665039 — Crash in folks_backends_sw_backend_add_service
Overview of changes from libfolks 0.6.4.1 to libfolks 0.6.5
=============================================================
{
if (!this._is_prepared)
{
+ /* Take a reference to the PersonaStore while waiting for the
+ * async call to return. See: bgo#665039. */
+ this.ref ();
+
this._service.get_static_capabilities (
(service, caps, error) =>
{
if (caps == null)
- return;
+ {
+ this.unref ();
+ return;
+ }
bool has_contacts = ClientService.has_cap (caps,
"has-contacts-query-iface");
if (!has_contacts)
- return;
+ {
+ this.unref ();
+ return;
+ }
+
var parameters = new HashTable<weak string, weak string>
(str_hash, str_equal);
+
+ /* Take another ref for this async call. */
+ this.ref ();
+
this._service.contacts_query_open_view
("people", parameters, (query, contact_view) =>
{
/* The D-Bus call could return an error. In this
* case, contact_view is null */
if (contact_view == null)
- return;
+ {
+ this.unref ();
+ return;
+ }
contact_view.contacts_added.connect
(this.contacts_added_cb);
this.notify_property ("is-quiescent");
this._contact_view.start ();
+
+ this.unref ();
});
+
+ this.unref ();
});
}
}
{
if (!this._is_prepared)
{
- this._client = new Client();
+ /* Hold a ref. on the Backend while we wait for the callback from
+ * this._client.get_services() to prevent the Backend being
+ * destroyed in the mean time. See: bgo#665039. */
+ this.ref ();
+
+ this._client = new Client ();
this._client.get_services((client, services) =>
{
foreach (var service_name in services)
this._is_quiescent = true;
this.notify_property ("is-quiescent");
+
+ this.unref ();
});
}
}