fixed refcount of eListboxPythonStringContent
[enigma2.git] / lib / python / enigma_python.i
index b84dbd14b25a92e54527d8314077caf067053ac7..ae15d0d9b451e00ca9d67a1fa87b1f922a897675 100644 (file)
@@ -33,6 +33,11 @@ is usually caused by not marking PSignals as immutable.
 
 */
 
+%define RefCount(...)
+%typemap(newfree) __VA_ARGS__ * { eDebug("adding ref"); $1->AddRef(); }
+%extend __VA_ARGS__  { ~__VA_ARGS__() { eDebug("removing ref!"); self->Release(); } }
+%ignore __VA_ARGS__::~__VA_ARGS__();
+%enddef
 
 %module enigma
 %{
@@ -59,6 +64,8 @@ extern void runMainloop();
 extern PSignal1<void,int> &keyPressedSignal();
 %}
 
+RefCount(eListboxPythonStringContent)
+
 #define DEBUG
 %include "stl.i"
 %include <lib/base/object.h>