1
0
Fork 0
mirror of https://github.com/zeldaret/oot.git synced 2025-05-10 02:54:24 +00:00

fix n64texconv python bindings memory management

This commit is contained in:
Dragorn421 2025-02-18 17:10:47 +01:00
parent ddec1a317c
commit ccb20a00b3
No known key found for this signature in database
GPG key ID: 381AEBAF3D429335

View file

@ -354,9 +354,9 @@ class N64Image(Structure):
return deref(ln64texconv.n64texconv_image_new(width, height, fmt, siz, pal))
def __del__(self):
ln64texconv.n64texconv_image_free(byref(self))
# Also free the palette if the reference count drops to 0
_object_refcount.rm_ref(self.pal, ln64texconv.n64texconv_palette_free)
ln64texconv.n64texconv_image_free(byref(self))
def copy(self) -> Optional["N64Image"]:
_object_refcount.add_ref(self.pal)