pygame-ce
pygame-ce copied to clipboard
Fix some surface refcounting issues in display
trafficstars
In get_surface, a strong reference was being incref-ed before being returned (double incref issue)
In set_mode there was a decref followed by an incref, which is technically wrong (I suppose in practice it doesn't create an issue, but I fixed it anyways)
In
set_modethere was a decref followed by an incref, which is technically wrong (I suppose in practice it doesn't create an issue, but I fixed it anyways)
What about the return here:
https://github.com/pygame-community/pygame-ce/blob/f5f850ac07a6aab001fb2d687879d4ab434e77cd/src_c/display.c#L1333-L1339
Won't removing the decref cause a leak if it returns NULL?