Enlightenment CVS committal

Author  : raster
Project : e17
Module  : apps/e

Dir     : e17/apps/e/src/bin


Modified Files:
        e_border.c 


Log Message:


fix border reffing unreffing. handy was wright... except he was uing a free
callabck fro objects not a del to emit a remvoe event and ref the object again
the object is already in the process of being destroyed. reffing it again
wont help you here in _free - thats why we have del callabcks to do this
before the final destruction... :)

===================================================================
RCS file: /cvsroot/enlightenment/e17/apps/e/src/bin/e_border.c,v
retrieving revision 1.58
retrieving revision 1.59
diff -u -3 -r1.58 -r1.59
--- e_border.c  11 Jan 2005 08:00:04 -0000      1.58
+++ e_border.c  11 Jan 2005 08:11:30 -0000      1.59
@@ -17,6 +17,7 @@
 
 /* local subsystem functions */
 static void _e_border_free(E_Border *bd);
+static void _e_border_del(E_Border *bd);
 
 /* FIXME: these likely belong in a separate icccm/client handler */
 /* and the border needs to be come a dumb object that just does what its */
@@ -152,7 +153,8 @@
    
    bd = E_OBJECT_ALLOC(E_Border, _e_border_free);
    if (!bd) return NULL;
-
+   e_object_del_func_set(bd, _e_border_del);
+   
    printf("##- NEW CLIENT 0x%x\n", win);
    bd->container = con;
    bd->zone = e_zone_current_get(con);
@@ -798,12 +800,6 @@
 static void
 _e_border_free(E_Border *bd)
 {
-   E_Event_Border_Remove *ev;
-
-   ev = calloc(1, sizeof(E_Event_Border_Remove));
-   ev->border = bd;
-   ecore_event_add(E_EVENT_BORDER_HIDE, ev, 
_e_border_event_border_remove_free, NULL);
-
    if (focused == bd) focused = NULL;
    while (bd->handlers)
      {
@@ -841,6 +837,17 @@
    free(bd);
 }
 
+static void
+_e_border_del(E_Border *bd)
+{
+   E_Event_Border_Remove *ev;
+
+   ev = calloc(1, sizeof(E_Event_Border_Remove));
+   ev->border = bd;
+   e_object_ref(E_OBJECT(bd));
+   ecore_event_add(E_EVENT_BORDER_REMOVE, ev, 
_e_border_event_border_remove_free, NULL);
+}
+
 static int
 _e_border_cb_window_show_request(void *data, int ev_type, void *ev)
 {
@@ -2768,6 +2775,7 @@
    E_Event_Border_Resize *e;
 
    e = ev;
+   e_object_unref(E_OBJECT(e->border));
    free(e);
 }
 




-------------------------------------------------------
The SF.Net email is sponsored by: Beat the post-holiday blues
Get a FREE limited edition SourceForge.net t-shirt from ThinkGeek.
It's fun and FREE -- well, almost....http://www.thinkgeek.com/sfshirt
_______________________________________________
enlightenment-cvs mailing list
enlightenment-cvs@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs

Reply via email to