Enlightenment CVS committal

Author  : barbieri
Project : e17
Module  : proto

Dir     : e17/proto/python-efl/python-evas/evas


Modified Files:
        evas.c_evas_object_smart.pxi 


Log Message:
Fix python object leak (it was self-referencing, circular dependency)

===================================================================
RCS file: 
/cvs/e/e17/proto/python-efl/python-evas/evas/evas.c_evas_object_smart.pxi,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -3 -r1.6 -r1.7
--- evas.c_evas_object_smart.pxi        11 May 2007 01:47:03 -0000      1.6
+++ evas.c_evas_object_smart.pxi        5 Jun 2007 05:22:00 -0000       1.7
@@ -2,6 +2,7 @@
 
 cdef object _smart_objects
 _smart_objects = dict()
+cdef object _smart_classes
 _smart_classes = list()
 
 
@@ -10,6 +11,15 @@
     obj = <SmartObject>Object_from_instance(o)
     if obj._m_delete is not None:
         obj._m_delete(obj)
+    obj._smart_callbacks = None
+    obj.delete = obj._m_delete or getattr(Object, "delete")
+    obj.move = obj._m_move or getattr(Object, "move")
+    obj.resize = obj._m_resize or getattr(Object, "resize")
+    obj.show = obj._m_show or getattr(Object, "show")
+    obj.hide = obj._m_hide or getattr(Object, "hide")
+    obj.color_set = obj._m_color_set or getattr(Object, "color_set")
+    obj.clip_set = obj._m_clip_set or getattr(Object, "clip_set")
+    obj.clip_unset = obj._m_clip_unset or getattr(Object, "clip_unset")
 
 
 cdef void _smart_object_move(Evas_Object *o, Evas_Coord x, Evas_Coord y):
@@ -67,6 +77,8 @@
     cdef SmartObject obj
     cdef object event, ei
     obj = <SmartObject>Object_from_instance(o)
+    if obj is <SmartObject>None or obj._smart_callbacks is None:
+        return
     event = <object>data
     ei = <object>event_info
     lst = obj._smart_callbacks[event]



-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
enlightenment-cvs mailing list
enlightenment-cvs@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs

Reply via email to