Hi Johan,
On Thu, Jul 14, 2011 at 10:44 AM, Johan Hedberg [off-list ref] wrote:
quoted
@@ -2605,10 +2605,15 @@ gboolean btd_device_remove_attio_callback(struct btd_device *device, guint id)
g_free(attio);
+ if (device->attios != NULL)
+ return TRUE;
+
if (device->attioid) {
g_source_remove(device->attioid);
device->attioid = 0;
}
+ g_attrib_unref(device->attrib);
+
return TRUE;
}
Looks like you're missing a device->attrib = NULL; after the unref.
I really don't see the point in setting a reference counted variable
to NULL. How would we know whether this is the last usage or not? In
this case we are just removing a callback. What if we registered two
callbacks?
Regards,
--
Anderson Lizardo
Instituto Nokia de Tecnologia - INdT
Manaus - Brazil