#include "accessible-leasing.h"
+#ifdef SPI_ATK_DEBUG
+#include "accessible-cache.h"
+#endif
+
/*---------------------------------------------------------------------------*/
SpiLeasing *spi_global_leasing;
{
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);
{
current = g_queue_pop_head (leasing->expiry_queue);
+#ifdef SPI_ATK_DEBUG
+ g_debug ("REVOKE - ");
+ spi_cache_print_info (current->object);
+#endif
+
g_object_unref (current->object);
g_slice_free (ExpiryElement, current);
The lease time is going to be rounded up, as the lease time should be
considered a MINIMUM that the object will be leased for.
*/
-#define LEASE_TIME_S 3
+#define LEASE_TIME_S 15
#define EXPIRY_TIME_S (LEASE_TIME_S + 1)
GObject *
add_expiry_timeout (leasing);
+#ifdef SPI_ATK_DEBUG
+ g_debug ("LEASE - ");
+ spi_cache_print_info (object);
+#endif
+
return object;
}