Lenard Lindstrom  committed 3705fa5

Fix Surface instance reference count bug when a Surface.get_view() is garbage collected.

Add an extra surface Py_DECREF to remove the new reference returned by PgView_GetParent().

  • Participants
  • Parent commits 7866ddf

Comments (0)

Files changed (1)

File src/surface.c

 static void
 surf_view_destr(PyObject *view)
-    PySurface_UnlockBy(PgView_GetParent(view), view);
+    PyObject *surf = PgView_GetParent(view);
+    PySurface_UnlockBy(surf, view);
+    Py_DECREF(surf);
 static PyObject *