X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=atk-adaptor%2Faccessible-leasing.c;h=dcddb0b5452f9e9d99b961e03cd5bb3b0a5e9940;hb=0d5406c910195ab9869f055d6a5ae8efb333c8a2;hp=28d40998314d970272754c9e34fab22f3c6f549d;hpb=5713a8e46559b6de9fbf5fc3e073d0d482d8c7e1;p=platform%2Fcore%2Fuifw%2Fat-spi2-atk.git diff --git a/atk-adaptor/accessible-leasing.c b/atk-adaptor/accessible-leasing.c index 28d4099..dcddb0b 100644 --- a/atk-adaptor/accessible-leasing.c +++ b/atk-adaptor/accessible-leasing.c @@ -26,6 +26,10 @@ #include "accessible-leasing.h" +#ifdef SPI_ATK_DEBUG +#include "accessible-cache.h" +#endif + /*---------------------------------------------------------------------------*/ SpiLeasing *spi_global_leasing; @@ -68,7 +72,9 @@ spi_leasing_finalize (GObject * object) { 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); } @@ -78,7 +84,7 @@ spi_leasing_dispose (GObject * 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); @@ -108,6 +114,11 @@ expiry_func (gpointer data) { 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); @@ -163,7 +174,7 @@ add_expiry_timeout (SpiLeasing * leasing) 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 * @@ -192,6 +203,11 @@ spi_leasing_take (SpiLeasing * leasing, GObject * object) add_expiry_timeout (leasing); +#ifdef SPI_ATK_DEBUG + g_debug ("LEASE - "); + spi_cache_print_info (object); +#endif + return object; }