kuuko pushed a commit to branch master.

commit 94df82ad33feac4232205354b859e54f47c2b9d9
Author: Kai Huuhko <[email protected]>
Date:   Tue Apr 23 15:04:05 2013 +0000

    Eo: Python objects should not be manipulated in __cinit__ and
    __dealloc__ methods. Initializing them *seems* to be safe though.
    
    And there's no need to initialize either the C objects to NULL nor
    python objects to None, this gets done automatically by Cython, along
    with initializing integers to 0.
---
 efl/eo/efl.eo.pyx | 4 ----
 1 file changed, 4 deletions(-)

diff --git a/efl/eo/efl.eo.pyx b/efl/eo/efl.eo.pyx
index 6ab3f85..3b1fab1 100644
--- a/efl/eo/efl.eo.pyx
+++ b/efl/eo/efl.eo.pyx
@@ -269,12 +269,8 @@ cdef class Eo(object):
     # c globals declared in eo.pxd (to make the class available to others)
 
     def __cinit__(self):
-        self.obj = NULL
         self.data = dict()
 
-    def __dealloc__(self):
-        self.data.clear()
-
     def __init__(self, *args, **kwargs):
         if type(self) is Eo:
             raise TypeError("Must not instantiate Eo, but subclasses")

-- 

------------------------------------------------------------------------------
Introducing AppDynamics Lite, a free troubleshooting tool for Java/.NET
Get 100% visibility into your production application - at no cost.
Code-level diagnostics for performance bottlenecks with <2% overhead
Download for free and get started troubleshooting in minutes.
http://p.sf.net/sfu/appdyn_d2d_ap1

Reply via email to