Permalink
Browse files

[fix] closes ##13506. Addon class instances that default to NULL were…

… causing an SEGV. This allows the generated code to handle NULL defaults.
  • Loading branch information...
1 parent 39af2a1 commit ec413440dcbaf40ca568934263946a55a58952f4 Jim Carroll committed Nov 11, 2012
Showing with 2 additions and 1 deletion.
  1. +2 −1 xbmc/interfaces/python/swig.h
@@ -100,7 +100,8 @@ namespace PythonBindings
inline void* retrieveApiInstance(const PyObject* pythonType, const char* expectedType, const char* methodNamespacePrefix,
const char* methodNameForErrorString) throw (XBMCAddon::WrongTypeException)
{
- return doretrieveApiInstance(((PyHolder*)pythonType),((PyHolder*)pythonType)->typeInfo, expectedType, methodNamespacePrefix, methodNameForErrorString);
+ return (pythonType == NULL) ? NULL :
+ doretrieveApiInstance(((PyHolder*)pythonType),((PyHolder*)pythonType)->typeInfo, expectedType, methodNamespacePrefix, methodNameForErrorString);
}
inline void prepareForReturn(XBMCAddon::AddonClass* c) { if(c) c->Acquire(); }

0 comments on commit ec41344

Please sign in to comment.