本文整理汇总了C++中PyObject_DEL函数的典型用法代码示例。如果您正苦于以下问题:C++ PyObject_DEL函数的具体用法?C++ PyObject_DEL怎么用?C++ PyObject_DEL使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了PyObject_DEL函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: ImageObject_dealloc
static inline void
ImageObject_dealloc(ImageObject* self)
{
imlib_context_set_image(self->image);
imlib_free_image();
PyObject_DEL(self);
}
示例2: PyObject_ClearWeakRefs
/**
* \param self A PyObjectPlus_Proxy
*/
void PyObjectPlus::py_base_dealloc(PyObject *self) // python wrapper
{
#ifdef USE_WEAKREFS
if (BGE_PROXY_WKREF(self) != NULL)
PyObject_ClearWeakRefs((PyObject *) self);
#endif
if (BGE_PROXY_PYREF(self)) {
PyObjectPlus *self_plus= BGE_PROXY_REF(self);
if (self_plus) {
if (BGE_PROXY_PYOWNS(self)) { /* Does python own this?, then delete it */
self_plus->m_proxy = NULL; /* Need this to stop ~PyObjectPlus from decrefing m_proxy otherwise its decref'd twice and py-debug crashes */
delete self_plus;
}
BGE_PROXY_REF(self)= NULL; // not really needed
}
// the generic pointer is not deleted directly, only through self_plus
BGE_PROXY_PTR(self)= NULL; // not really needed
} else {
void *ptr= BGE_PROXY_PTR(self);
if (ptr) {
if (BGE_PROXY_PYOWNS(self)) { /* Does python own this?, then delete it */
// generic structure owned by python MUST be created though MEM_alloc
MEM_freeN(ptr);
}
BGE_PROXY_PTR(self)= NULL; // not really needed
}
}
#if 0
/* is ok normally but not for subtyping, use tp_free instead. */
PyObject_DEL( self );
#else
Py_TYPE(self)->tp_free(self);
#endif
};
示例3: PyDiaError_Dealloc
/*
* Dealloc
*/
static void
PyDiaError_Dealloc(PyDiaError *self)
{
if (self->str)
g_string_free (self->str, TRUE);
PyObject_DEL(self);
}
示例4: fs_root_dealloc
static void fs_root_dealloc(PyObject *self)
{
FileSystemRootObject *fsobj = (FileSystemRootObject *)self;
apr_pool_destroy(fsobj->pool);
PyObject_DEL(fsobj);
}
示例5: lxcXCFunctional_dealloc
static void lxcXCFunctional_dealloc(lxcXCFunctionalObject *self)
{
/* destroy xc functional */
switch(self->xc_functional.family)
{
case XC_FAMILY_GGA:
XC(gga_end)(&(self->xc_functional.gga_func));
break;
case XC_FAMILY_HYB_GGA:
XC(hyb_gga_end)(&(self->xc_functional.hyb_gga_func));
break;
case XC_FAMILY_MGGA:
XC(mgga_end)(&(self->xc_functional.mgga_func));
break;
case XC_FAMILY_LCA:
/* XC(lca_end)(&(self->xc_functional.lca_func)); */ /* MDTMP - does not exist in libx! */
break;
/* default: */
/* printf("lxcXCFunctional_dealloc: cannot destroy nonexisting %d xc functional\n", self->xc_functional.family); */
}
/* destroy x functional */
switch(self->x_functional.family)
{
case XC_FAMILY_LDA:
/*XC(lda_end)(&(self->x_functional.lda_func)); */
break;
case XC_FAMILY_GGA:
XC(gga_end)(&(self->x_functional.gga_func));
break;
case XC_FAMILY_HYB_GGA:
XC(hyb_gga_end)(&(self->x_functional.hyb_gga_func));
break;
case XC_FAMILY_MGGA:
XC(mgga_end)(&(self->x_functional.mgga_func));
break;
/* default: */
/* printf("lxcXCFunctional_dealloc: cannot destroy nonexisting %d x functional\n", self->x_functional.family); */
}
/* destroy c functional */
switch(self->c_functional.family)
{
case XC_FAMILY_LDA:
/* XC(lda_end)(&(self->c_functional.lda_func)); */
break;
case XC_FAMILY_GGA:
XC(gga_end)(&(self->c_functional.gga_func));
break;
case XC_FAMILY_HYB_GGA:
XC(hyb_gga_end)(&(self->c_functional.hyb_gga_func));
break;
case XC_FAMILY_MGGA:
XC(mgga_end)(&(self->c_functional.mgga_func));
break;
/* default: */
/* printf("lxcXCFunctional_dealloc: cannot destroy nonexisting %d c functional\n", self->c_functional.family); */
}
PyObject_DEL(self);
}
示例6: tile_dealloc
static void
tile_dealloc(PyGimpTile *self)
{
gimp_tile_unref(self->tile, FALSE);
Py_DECREF(self->drawable);
PyObject_DEL(self);
}
示例7: TimeStamp_dealloc
static void
TimeStamp_dealloc(TimeStamp *self)
{
#ifdef USE_EXTENSION_CLASS
Py_DECREF(self->ob_type);
#endif
PyObject_DEL(self);
}
示例8: deAlloc
static void deAlloc (_ScanDevice * self)
{
if (self->h)
sane_close (self->h);
self->h = NULL;
PyObject_DEL (self);
}
示例9: Hyphen_dealloc
static void
Hyphen_dealloc(Hyphenobject *self) {
if (self->hdict != NULL) {
hnj_hyphen_free(self->hdict);
self->hdict = NULL;
}
PyObject_DEL(self);
}
示例10: Splitter_dealloc
static void
Splitter_dealloc(Splitter *self)
{
hashtable_destroy(self->cache, 1);
Py_XDECREF(self->list);
// PyMem_DEL(self);
PyObject_DEL(self);
}
示例11: pycorba_any_dealloc
static void
pycorba_any_dealloc(PyCORBA_Any *self)
{
if (self->any._type)
CORBA_Object_release((CORBA_Object)self->any._type, NULL);
CORBA_free(self->any._value);
PyObject_DEL(self);
}
示例12: Py_LOCAL
Py_LOCAL(void) avl_tree_dealloc(avl_tree_Object * self)
{
avl_destroy(self->tree);
self->tree = NULL;
Py_DECREF(self->compare_func);
self->compare_func = NULL;
PyObject_DEL(self);
}
示例13: fsimage_file_dealloc
static void
fsimage_file_dealloc(fsimage_file_t *file)
{
if (file->file != NULL)
fsi_close_file(file->file);
Py_XDECREF(file->fs);
PyObject_DEL(file);
}
示例14: BTreeItems_dealloc
static void
BTreeItems_dealloc(BTreeItems *self)
{
Py_XDECREF(self->firstbucket);
Py_XDECREF(self->lastbucket);
Py_XDECREF(self->currentbucket);
PyObject_DEL(self);
}
示例15: PythonSatGraph_dealloc
static void
PythonSatGraph_dealloc(PythonSatGraph *xp)
{
DestroySatGraph(xp->theGraph);
free(xp->theGraph);
Py_XDECREF(xp->x_attr);
PyObject_DEL(xp);
}