static void GrDev_dealloc(PyGrDevObject *self) { #ifdef RPY_DEBUG_GRDEV printf("FIXME: Deallocating GrDev (device number %i).\n", RPY_DEV_NUM(self)); #endif pGEDevDesc dd = GEgetDevice(RPY_DEV_NUM(self)-1); /* Caution: GEkillDevice will call the method "close()" for the the device. */ /* (See GrDev_close for details) */ if (dd) GEkillDevice(dd); #ifdef RPY_DEBUG_GRDEV printf("GrDevDealloc: PyMem_Free()\n"); #endif printf("--> skipping PyMem_Free(((PyGrDevObject *)self)->grdev) \n"); //PyMem_Free(((PyGrDevObject *)self)->grdev); #if (PY_VERSION_HEX < 0x03010000) self->ob_type->tp_free((PyObject*)self); #else Py_TYPE(self)->tp_free((PyObject*)self); #endif #ifdef RPY_DEBUG_GRDEV printf(" done.\n"); #endif }
void dump() { DEVICE_TRACE; if (INSTANCE != NULL) { GEkillDevice(INSTANCE); INSTANCE = NULL; } }
void ide_device::output_and_kill_file_device() { rhost::util::errors_to_exceptions([&] { // The device number is not constant, so get the current number int file_device_num = Rf_ndevNumber(_file_device); // Killing the device will call close, which will save the file to disk pGEDevDesc ge_dev_desc = GEgetDevice(file_device_num); GEkillDevice(ge_dev_desc); }); // Blank our state, next call to graphics primitive (if any) will create // a new file device on demand _file_device = nullptr; _file_device_filename = std::tr2::sys::path(); }