discomfitor pushed a commit to branch enlightenment-0.19.

http://git.enlightenment.org/core/enlightenment.git/commit/?id=cbe533c8481f95ee4a3cb04b101f76b7ae6875ee

commit cbe533c8481f95ee4a3cb04b101f76b7ae6875ee
Author: Carsten Haitzler (Rasterman) <ras...@rasterman.com>
Date:   Tue Apr 21 09:36:33 2015 +0900

    e client - desk wait - ref it properly and clean up delfn
    
    delfn's on desks being referred to as profile.wait_desk were never
    cleared when client was freed. als the desk itself never got an obj
    reference - fix that and ref/unref it.
---
 src/bin/e_client.c | 19 ++++++++++++++++++-
 1 file changed, 18 insertions(+), 1 deletion(-)

diff --git a/src/bin/e_client.c b/src/bin/e_client.c
index 64ed3c8..a819c1c 100644
--- a/src/bin/e_client.c
+++ b/src/bin/e_client.c
@@ -195,10 +195,13 @@ _e_client_desk_window_profile_wait_desk_delfn(void *data, 
void *obj)
    const char *p;
    int i;
 
+   printf("DELFN %p\n", ec);
    if (e_object_is_del(E_OBJECT(ec))) return;
 
    ec->e.state.profile.wait_desk_delfn = NULL;
    eina_stringshare_replace(&ec->e.state.profile.wait, NULL);
+   if (ec->e.state.profile.wait_desk)
+     e_object_unref(E_OBJECT(ec->e.state.profile.wait_desk));
    ec->e.state.profile.wait_desk = NULL;
    ec->e.state.profile.wait_for_done = 0;
 
@@ -540,6 +543,14 @@ _e_client_free(E_Client *ec)
 
    e_hints_client_list_set();
    evas_object_del(ec->frame);
+   if (ec->e.state.profile.wait_desk)
+     {
+        e_object_delfn_del(E_OBJECT(ec->e.state.profile.wait_desk),
+                           ec->e.state.profile.wait_desk_delfn);
+        ec->e.state.profile.wait_desk_delfn = NULL;
+        e_object_unref(E_OBJECT(ec->e.state.profile.wait_desk));
+     }
+   ec->e.state.profile.wait_desk = NULL;
    free(ec);
 }
 
@@ -2606,15 +2617,21 @@ e_client_desk_window_profile_wait_desk_set(E_Client 
*ec, E_Desk *desk)
         ec->e.state.profile.wait_desk_delfn = NULL;
      }
 
+   if (ec->e.state.profile.wait_desk)
+     e_object_unref(E_OBJECT(ec->e.state.profile.wait_desk));
+   ec->e.state.profile.wait_desk = NULL;
+
    if (desk)
      {
+        printf("ADD DELFN to %p\n", desk);
         ec->e.state.profile.wait_desk_delfn =
            e_object_delfn_add(E_OBJECT(desk),
                               _e_client_desk_window_profile_wait_desk_delfn,
                               ec);
      }
-
    ec->e.state.profile.wait_desk = desk;
+   if (ec->e.state.profile.wait_desk)
+     e_object_ref(E_OBJECT(ec->e.state.profile.wait_desk));
 }
 
 EAPI void

-- 


Reply via email to