Exemplo n.º 1
0
static inline void
ImageObject_dealloc(ImageObject* self)
{
    imlib_context_set_image(self->image);
    imlib_free_image();
    PyObject_DEL(self);
}
/**
 * \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
};
Exemplo n.º 3
0
/*
 * Dealloc
 */
static void
PyDiaError_Dealloc(PyDiaError *self)
{
  if (self->str)
    g_string_free (self->str, TRUE);
  PyObject_DEL(self);
}
Exemplo n.º 4
0
static void fs_root_dealloc(PyObject *self)
{
	FileSystemRootObject *fsobj = (FileSystemRootObject *)self;

	apr_pool_destroy(fsobj->pool);
	PyObject_DEL(fsobj);
}
Exemplo n.º 5
0
Arquivo: libxc.c Projeto: qsnake/gpaw
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);
}
Exemplo n.º 6
0
static void
tile_dealloc(PyGimpTile *self)
{
    gimp_tile_unref(self->tile, FALSE);

    Py_DECREF(self->drawable);
    PyObject_DEL(self);
}
Exemplo n.º 7
0
static void
TimeStamp_dealloc(TimeStamp *self)
{
#ifdef USE_EXTENSION_CLASS
  Py_DECREF(self->ob_type);
#endif  
  PyObject_DEL(self);
}
Exemplo n.º 8
0
static void deAlloc (_ScanDevice * self)
{
    if (self->h)
        sane_close (self->h);

    self->h = NULL;
    PyObject_DEL (self);
}
Exemplo n.º 9
0
static void
Hyphen_dealloc(Hyphenobject *self) {
  if (self->hdict != NULL) {
    hnj_hyphen_free(self->hdict);
    self->hdict = NULL;
  }
  PyObject_DEL(self);
}
Exemplo n.º 10
0
static void
Splitter_dealloc(Splitter *self)
{
    hashtable_destroy(self->cache, 1);
    Py_XDECREF(self->list);
//    PyMem_DEL(self);
    PyObject_DEL(self);
}
Exemplo n.º 11
0
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);
}
Exemplo n.º 12
0
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);
}
Exemplo n.º 13
0
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);
}
Exemplo n.º 14
0
static void
BTreeItems_dealloc(BTreeItems *self)
{
  Py_XDECREF(self->firstbucket);
  Py_XDECREF(self->lastbucket);
  Py_XDECREF(self->currentbucket);
  PyObject_DEL(self);
}
Exemplo n.º 15
0
static void
PythonSatGraph_dealloc(PythonSatGraph *xp)
{
	DestroySatGraph(xp->theGraph);
	free(xp->theGraph);
	Py_XDECREF(xp->x_attr);
	PyObject_DEL(xp);
}
Exemplo n.º 16
0
void
PyFrame_Fini(void)
{
	while (free_list != NULL) {
		PyFrameObject *f = free_list;
		free_list = free_list->f_back;
		PyObject_DEL(f);
	}
}
Exemplo n.º 17
0
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);
}
Exemplo n.º 18
0
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);
}
Exemplo n.º 19
0
static void
pf_dealloc(PyGimpPixelFetcher *self)
{
    gimp_pixel_fetcher_destroy(self->pf);

    Py_XDECREF(self->drawable);

    PyObject_DEL(self);
}
Exemplo n.º 20
0
static void
fs_dealloc (Filesystem *self)
{
  if (self->fs)
    ocfs2_close (self->fs);

  Py_XDECREF (self->device);
  PyObject_DEL (self);
}
Exemplo n.º 21
0
void
PyCFunction_Fini(void)
{
	while (free_list) {
		PyCFunctionObject *v = free_list;
		free_list = (PyCFunctionObject *)(v->m_self);
		PyObject_DEL(v);
	}
}
Exemplo n.º 22
0
static void p_cgi_dealloc (CGIObject *ho)
{
  if (ho->cgi)
  {
    cgi_destroy (&(ho->cgi));
  }
  Py_XDECREF(ho->hdf);
  PyObject_DEL(ho);
}
Exemplo n.º 23
0
static void
dir_scan_iter_dealloc (DirScanIter *self)
{
  if (self->scan)
    ocfs2_close_dir_scan (self->scan);

  Py_XDECREF (self->fs_obj);
  PyObject_DEL (self);
}
Exemplo n.º 24
0
static void
capsule_dealloc(PyObject *o)
{
    PyCapsule *capsule = (PyCapsule *)o;
    if (capsule->destructor) {
        capsule->destructor(o);
    }
    PyObject_DEL(o);
}
Exemplo n.º 25
0
static void
PyGdkWindow_Dealloc(PyGdkWindow_Object *self)
{
    if (gdk_drawable_get_type(self->obj) == GDK_WINDOW_PIXMAP)
	g_object_unref(self->obj);
    else
	g_object_unref(self->obj);
    PyObject_DEL(self);
}
Exemplo n.º 26
0
static void PgVersion_dealloc(PgVersion *self)
{
	Py_XDECREF(self->version);
	Py_XDECREF(self->major);
	Py_XDECREF(self->minor);
	Py_XDECREF(self->patch);
	Py_XDECREF(self->post70);
	Py_XDECREF(self->value);
	PyObject_DEL(self);
}
Exemplo n.º 27
0
void
ClientObject_list_clear(void)
{
    ClientObject *op;

    while (client_numfree) {
        op = client_free_list[--client_numfree];
        PyObject_DEL(op);
    }
}
Exemplo n.º 28
0
static  void
dealloc_ClientObject(ClientObject *client)
{
    Py_CLEAR(client->greenlet);
    if (client_numfree < CLIENT_MAXFREELIST){
        client_free_list[client_numfree++] = client;
        GDEBUG("back to pool %p", client);
    }else{
        PyObject_DEL(client);
    }
}
Exemplo n.º 29
0
/*sound object internals*/
static void
movie_dealloc (PyObject* self)
{
    SMPEG* movie = PyMovie_AsSMPEG (self);
    Py_BEGIN_ALLOW_THREADS;
    SMPEG_delete (movie);
    Py_END_ALLOW_THREADS;
    Py_XDECREF (((PyMovieObject*) self)->surftarget);
    Py_XDECREF (((PyMovieObject*) self)->filesource);
    PyObject_DEL (self);
}
Exemplo n.º 30
0
static void
PyCObject_dealloc(PyCObject *self)
{
    if (self->destructor) {
        if(self->desc)
            ((destructor2)(self->destructor))(self->cobject, self->desc);
        else
            (self->destructor)(self->cobject);
    }
    PyObject_DEL(self);
}