fix: reference was borrows, don't decref it
authorFelix Domke <tmbinc@elitedvb.net>
Mon, 5 Dec 2005 03:38:40 +0000 (03:38 +0000)
committerFelix Domke <tmbinc@elitedvb.net>
Mon, 5 Dec 2005 03:38:40 +0000 (03:38 +0000)
lib/gui/elistboxcontent.cpp

index 1391a2b56f2e44a320c12caac075b7216bfd7d8a..362a3f8410782aadc16f4578bc513e80fc620471 100644 (file)
@@ -422,7 +422,7 @@ void eListboxPythonConfigContent::paint(gPainter &painter, eWindowStyle &style,
                                /* handle left part. get item from tuple, convert to string, display. */
                                
                        text = PyTuple_GetItem(item, 0);
                                /* handle left part. get item from tuple, convert to string, display. */
                                
                        text = PyTuple_GetItem(item, 0);
-                       text = PyObject_Str(text);
+                       text = PyObject_Str(text); /* creates a new object - old object was borrowed! */
                        const char *string = (text && PyString_Check(text)) ? PyString_AsString(text) : "<not-a-string>";
                        eSize item_left = eSize(m_seperation, m_itemsize.height());
                        eSize item_right = eSize(m_itemsize.width() - m_seperation, m_itemsize.height());
                        const char *string = (text && PyString_Check(text)) ? PyString_AsString(text) : "<not-a-string>";
                        eSize item_left = eSize(m_seperation, m_itemsize.height());
                        eSize item_right = eSize(m_itemsize.width() - m_seperation, m_itemsize.height());
@@ -525,7 +525,7 @@ void eListboxPythonConfigContent::paint(gPainter &painter, eWindowStyle &style,
                                                        /* plist is 0 or borrowed */
                                        }
                                }
                                                        /* plist is 0 or borrowed */
                                        }
                                }
-                               Py_XDECREF(type);
+                                       /* type is borrowed */
                        } else
                                eWarning("eListboxPythonConfigContent: second value of tuple is not a tuple.");
                                /* value is borrowed */
                        } else
                                eWarning("eListboxPythonConfigContent: second value of tuple is not a tuple.");
                                /* value is borrowed */