Fix mock window not being zeroes on creation
This commit is contained in:
parent
0f003a9a77
commit
efe4c32ffd
1 changed files with 2 additions and 2 deletions
|
|
@ -977,7 +977,7 @@ destroy_mock_window(PyObject *capsule) {
|
|||
Window *w = PyCapsule_GetPointer(capsule, "Window");
|
||||
if (w) {
|
||||
destroy_window(w);
|
||||
PyMem_Del(w);
|
||||
PyMem_Free(w);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -986,7 +986,7 @@ pycreate_mock_window(PyObject *self UNUSED, PyObject *args) {
|
|||
Screen *screen;
|
||||
PyObject *title = NULL;
|
||||
if (!PyArg_ParseTuple(args, "O|U", &screen, &title)) return NULL;
|
||||
Window *w = PyMem_New(Window, 1);
|
||||
Window *w = PyMem_Calloc(sizeof(Window), 1);
|
||||
if (!w) return NULL;
|
||||
Py_INCREF(screen);
|
||||
PyObject *ans = PyCapsule_New(w, "Window", destroy_mock_window);
|
||||
|
|
|
|||
Loading…
Reference in a new issue