MCPcopy Create free account
hub / github.com/cruppstahl/upscaledb / db_dealloc

Function db_dealloc

python/src/python.cc:76–105  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

74} UpsResult;
75
76static void
77db_dealloc(UpsDatabase *self)
78{
79 if (!self->db)
80 return;
81
82 /* close the other members */
83 Py_XDECREF(self->comparecb);
84 Py_XDECREF(self->err_type);
85 Py_XDECREF(self->err_value);
86 Py_XDECREF(self->err_traceback);
87 if (self->cursorlist) {
88 Py_ssize_t i, size = PyList_GET_SIZE(self->cursorlist);
89 for (i = 0; i < size; i++) {
90 UpsCursor *c = (UpsCursor *)PyList_GET_ITEM(self->cursorlist, i);
91 if (c && c->cursor) {
92 ups_cursor_close(c->cursor);
93 c->cursor = 0;
94 }
95 Py_XDECREF(c);
96 }
97 Py_DECREF(self->cursorlist);
98 self->cursorlist = 0;
99 }
100
101 ups_db_close(self->db, 0);
102 self->db = 0;
103
104 PyObject_Del(self);
105}
106
107static bool
108parse_parameters(PyObject *extargs, std::vector<ups_parameter_t> &params)

Callers 2

env_create_dbFunction · 0.85
env_open_dbFunction · 0.85

Calls 1

ups_db_closeFunction · 0.85

Tested by

no test coverage detected