@ -551,7 +551,7 @@ static int getSelfFromArgs(sipTypeDef *td, PyObject *args, int argnr,
sipSimpleWrapper * * selfp ) ;
sipSimpleWrapper * * selfp ) ;
static PyObject * createEnumMember ( sipTypeDef * td , sipEnumMemberDef * enm ) ;
static PyObject * createEnumMember ( sipTypeDef * td , sipEnumMemberDef * enm ) ;
static int compareTypedefName ( const void * key , const void * el ) ;
static int compareTypedefName ( const void * key , const void * el ) ;
static int checkPointer ( void * ptr );
static int checkPointer ( void * ptr , sipSimpleWrapper * sw );
static void * cast_cpp_ptr ( void * ptr , PyTypeObject * src_type ,
static void * cast_cpp_ptr ( void * ptr , PyTypeObject * src_type ,
const sipTypeDef * dst_type ) ;
const sipTypeDef * dst_type ) ;
static void finalise ( void ) ;
static void finalise ( void ) ;
@ -1040,7 +1040,7 @@ static PyObject *callDtor(PyObject *self, PyObject *args)
addr = getPtrTypeDef ( sw , & ctd ) ;
addr = getPtrTypeDef ( sw , & ctd ) ;
if ( checkPointer ( addr ) < 0 )
if ( checkPointer ( addr , sw ) < 0 )
return NULL ;
return NULL ;
if ( PyObject_TypeCheck ( ( PyObject * ) sw , ( PyTypeObject * ) & sipWrapper_Type ) )
if ( PyObject_TypeCheck ( ( PyObject * ) sw , ( PyTypeObject * ) & sipWrapper_Type ) )
@ -7418,7 +7418,7 @@ void *sip_api_get_cpp_ptr(sipSimpleWrapper *sw, const sipTypeDef *td)
{
{
void * ptr = sipGetAddress ( sw ) ;
void * ptr = sipGetAddress ( sw ) ;
if ( checkPointer ( ptr ) < 0 )
if ( checkPointer ( ptr , sw ) < 0 )
return NULL ;
return NULL ;
if ( td ! = NULL )
if ( td ! = NULL )
@ -7454,12 +7454,14 @@ static void *cast_cpp_ptr(void *ptr, PyTypeObject *src_type,
/*
/*
* Check that a pointer is non - NULL .
* Check that a pointer is non - NULL .
*/
*/
static int checkPointer ( void * ptr )
static int checkPointer ( void * ptr , sipSimpleWrapper * sw )
{
{
if ( ptr = = NULL )
if ( ptr = = NULL )
{
{
PyErr_SetString ( PyExc_RuntimeError ,
PyErr_Format ( PyExc_RuntimeError , ( sipWasCreated ( sw ) ?
" underlying C/C++ object has been deleted " ) ;
" wrapped C/C++ object of type %s has been deleted " :
" super-class __init__() of type %s was never called " ) ,
Py_TYPE ( sw ) - > tp_name ) ;
return - 1 ;
return - 1 ;
}
}
@ -8701,7 +8703,7 @@ static int sipSimpleWrapper_init(sipSimpleWrapper *self, PyObject *args,
}
}
self - > u . cppPtr = sipNew ;
self - > u . cppPtr = sipNew ;
self - > flags = sipFlags ;
self - > flags = sipFlags | SIP_CREATED ;
if ( ! sipNotInMap ( self ) )
if ( ! sipNotInMap ( self ) )
sipOMAddObject ( & cppPyMap , self ) ;
sipOMAddObject ( & cppPyMap , self ) ;