kuuko pushed a commit to branch master.
commit 095f7fd867e912713e00850bb4b2fab42f85b44a
Author: Kai Huuhko <[email protected]>
Date: Sun Mar 24 18:34:19 2013 +0000
Add comments to point out the trouble areas in the string conv
functions.
---
efl/eo/efl.eo.pyx | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/efl/eo/efl.eo.pyx b/efl/eo/efl.eo.pyx
index 2de0eca..9e5f11f 100644
--- a/efl/eo/efl.eo.pyx
+++ b/efl/eo/efl.eo.pyx
@@ -49,9 +49,11 @@ cdef char *_fruni(s):
return NULL
if isinstance(s, unicode):
string = s.encode('UTF-8')
+ # XXX: We lose reference here
c_string = string
elif isinstance(s, str):
c_string = s
+ # XXX: Reference is lost unless the user keeps the string object around
else:
raise TypeError("Expected str or unicode object, got %s" %
(type(s).__name__))
return c_string
@@ -63,9 +65,11 @@ cdef const_char *_cfruni(s):
return NULL
if isinstance(s, unicode):
string = s.encode('UTF-8')
+ # XXX: We lose reference here
c_string = string
elif isinstance(s, str):
c_string = s
+ # XXX: Reference is lost unless the user keeps the string object around
else:
raise TypeError("Expected str or unicode object, got %s" %
(type(s).__name__))
return c_string
--
------------------------------------------------------------------------------
Everyone hates slow websites. So do we.
Make your web apps faster with AppDynamics
Download AppDynamics Lite for free today:
http://p.sf.net/sfu/appdyn_d2d_mar