Skip to content

Commit f5f850a

Browse files
committed
Fix some surface refcounting issues in display
1 parent cdc2756 commit f5f850a

File tree

1 file changed

+0
-3
lines changed

1 file changed

+0
-3
lines changed

src_c/display.c

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -588,7 +588,6 @@ pg_get_surface(PyObject *self, PyObject *_null)
588588
if (!new_surface)
589589
return NULL;
590590
pg_SetDefaultWindowSurface(new_surface);
591-
Py_INCREF((PyObject *)new_surface);
592591
return (PyObject *)new_surface;
593592
}
594593
Py_INCREF(old_surface);
@@ -1312,7 +1311,6 @@ pg_set_mode(PyObject *self, PyObject *arg, PyObject *kwds)
13121311
/*no errors; make the window available*/
13131312
pg_SetDefaultWindow(win);
13141313
pg_SetDefaultWindowSurface(surface);
1315-
Py_DECREF(surface);
13161314

13171315
/* ensure window is always black after a set_mode call */
13181316
SDL_FillRect(surf, NULL, SDL_MapRGB(surf->format, 0, 0, 0));
@@ -1344,7 +1342,6 @@ pg_set_mode(PyObject *self, PyObject *arg, PyObject *kwds)
13441342
SDL_PumpEvents();
13451343

13461344
/*return the window's surface (screen)*/
1347-
Py_INCREF(surface);
13481345
return (PyObject *)surface;
13491346

13501347
DESTROY_WINDOW:

0 commit comments

Comments
 (0)