{
SpiLeasing *leasing = SPI_LEASING (object);
- g_free (leasing->expiry_queue);
+ if (leasing->expiry_func_id)
+ g_source_remove (leasing->expiry_func_id);
+ g_queue_free (leasing->expiry_queue);
G_OBJECT_CLASS (spi_leasing_parent_class)->finalize (object);
}
SpiLeasing *leasing = SPI_LEASING (object);
ExpiryElement *head;
- while (head = g_queue_pop_head (leasing->expiry_queue))
+ while ((head = g_queue_pop_head (leasing->expiry_queue)))
{
g_object_unref (head->object);
g_slice_free (ExpiryElement, head);