• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C++ PyObject_DEL函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C++中PyObject_DEL函数的典型用法代码示例。如果您正苦于以下问题:C++ PyObject_DEL函数的具体用法?C++ PyObject_DEL怎么用?C++ PyObject_DEL使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了PyObject_DEL函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。

示例1: ImageObject_dealloc

static inline void
ImageObject_dealloc(ImageObject* self)
{
    imlib_context_set_image(self->image);
    imlib_free_image();
    PyObject_DEL(self);
}
开发者ID:Dmdv,项目名称:pyimlib2,代码行数:7,代码来源:image.c


示例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
};
开发者ID:JasonWilkins,项目名称:blender-viewport_fx,代码行数:38,代码来源:PyObjectPlus.cpp


示例3: PyDiaError_Dealloc

/*
 * Dealloc
 */
static void
PyDiaError_Dealloc(PyDiaError *self)
{
  if (self->str)
    g_string_free (self->str, TRUE);
  PyObject_DEL(self);
}
开发者ID:GNOME,项目名称:dia,代码行数:10,代码来源:pydia-error.c


示例4: fs_root_dealloc

static void fs_root_dealloc(PyObject *self)
{
	FileSystemRootObject *fsobj = (FileSystemRootObject *)self;

	apr_pool_destroy(fsobj->pool);
	PyObject_DEL(fsobj);
}
开发者ID:ardumont,项目名称:subvertpy,代码行数:7,代码来源:repos.c


示例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);
}
开发者ID:qsnake,项目名称:gpaw,代码行数:59,代码来源:libxc.c


示例6: tile_dealloc

static void
tile_dealloc(PyGimpTile *self)
{
    gimp_tile_unref(self->tile, FALSE);

    Py_DECREF(self->drawable);
    PyObject_DEL(self);
}
开发者ID:jdburton,项目名称:gimp-osx,代码行数:8,代码来源:pygimp-tile.c


示例7: TimeStamp_dealloc

static void
TimeStamp_dealloc(TimeStamp *self)
{
#ifdef USE_EXTENSION_CLASS
  Py_DECREF(self->ob_type);
#endif  
  PyObject_DEL(self);
}
开发者ID:OS2World,项目名称:APP-SERVER-Zope,代码行数:8,代码来源:TimeStamp.c


示例8: deAlloc

static void deAlloc (_ScanDevice * self)
{
    if (self->h)
        sane_close (self->h);

    self->h = NULL;
    PyObject_DEL (self);
}
开发者ID:danwallach,项目名称:VoteBox-v1,代码行数:8,代码来源:scanext.c


示例9: Hyphen_dealloc

static void
Hyphen_dealloc(Hyphenobject *self) {
  if (self->hdict != NULL) {
    hnj_hyphen_free(self->hdict);
    self->hdict = NULL;
  }
  PyObject_DEL(self);
}
开发者ID:AceZOfZSpades,项目名称:RankPanda,代码行数:8,代码来源:pyHnjmodule.c


示例10: Splitter_dealloc

static void
Splitter_dealloc(Splitter *self)
{
    hashtable_destroy(self->cache, 1);
    Py_XDECREF(self->list);
//    PyMem_DEL(self);
    PyObject_DEL(self);
}
开发者ID:zopyx,项目名称:zopyx.txng3.ext,代码行数:8,代码来源:splitter.c


示例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);
}
开发者ID:fatman2021,项目名称:python-corba,代码行数:8,代码来源:pycorba-any.c


示例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);
}
开发者ID:PypeBros,项目名称:skiptree,代码行数:8,代码来源:avlmodule.c


示例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);
}
开发者ID:0day-ci,项目名称:xen,代码行数:8,代码来源:fsimage.c


示例14: BTreeItems_dealloc

static void
BTreeItems_dealloc(BTreeItems *self)
{
  Py_XDECREF(self->firstbucket);
  Py_XDECREF(self->lastbucket);
  Py_XDECREF(self->currentbucket);
  PyObject_DEL(self);
}
开发者ID:goschtl,项目名称:zope,代码行数:8,代码来源:BTreeItemsTemplate.c


示例15: PythonSatGraph_dealloc

static void
PythonSatGraph_dealloc(PythonSatGraph *xp)
{
	DestroySatGraph(xp->theGraph);
	free(xp->theGraph);
	Py_XDECREF(xp->x_attr);
	PyObject_DEL(xp);
}
开发者ID:PedersenThomas,项目名称:Fault-Tolerant-Systems,代码行数:8,代码来源:pySAT.c


示例16: PyFrame_Fini

void
PyFrame_Fini(void)
{
	while (free_list != NULL) {
		PyFrameObject *f = free_list;
		free_list = free_list->f_back;
		PyObject_DEL(f);
	}
}
开发者ID:Claruarius,项目名称:stblinux-2.6.37,代码行数:9,代码来源:frameobject.c


示例17: p_hdf_dealloc

static void p_hdf_dealloc (HDFObject *ho)
{
  /* ne_warn("deallocating hdf: %X", ho); */
  if (ho->data && ho->dealloc)
  {
    hdf_destroy (&(ho->data));
  }
  PyObject_DEL(ho);
}
开发者ID:HermannDppes,项目名称:clearsilver,代码行数:9,代码来源:neo_util.c


示例18: PyShmSemaphore_dealloc

static void
PyShmSemaphore_dealloc(
    PyShmSemObj *self)
{
    /* del sem_dict[key], ignore if it fails */
    if (PyDict_DelItem(sem_dict, PyInt_FromLong(self->semid)) == -1)
	PyErr_Clear();
    PyObject_DEL(self);
}
开发者ID:clones,项目名称:kaa,代码行数:9,代码来源:shmmodule.c


示例19: pf_dealloc

static void
pf_dealloc(PyGimpPixelFetcher *self)
{
    gimp_pixel_fetcher_destroy(self->pf);

    Py_XDECREF(self->drawable);

    PyObject_DEL(self);
}
开发者ID:jdburton,项目名称:gimp-osx,代码行数:9,代码来源:pygimp-tile.c


示例20: fs_dealloc

static void
fs_dealloc (Filesystem *self)
{
  if (self->fs)
    ocfs2_close (self->fs);

  Py_XDECREF (self->device);
  PyObject_DEL (self);
}
开发者ID:pepe5,项目名称:ocfs2-tools,代码行数:9,代码来源:ocfs2module.c



注:本文中的PyObject_DEL函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ PyObject_Del函数代码示例发布时间:2022-05-30
下一篇:
C++ PyObject_ClearWeakRefs函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap