Destroy pixel buffer

This commit is contained in:
gingerBill
2022-05-14 15:16:14 +01:00
parent e8485ee7e7
commit 22dc020647

View File

@@ -2,6 +2,7 @@ package image
import "core:mem"
import "core:os"
import "core:bytes"
Loader_Proc :: #type proc(data: []byte, options: Options, allocator: mem.Allocator) -> (img: ^Image, err: Error)
Destroy_Proc :: #type proc(img: ^Image)
@@ -54,6 +55,7 @@ destroy :: proc(img: ^Image, allocator := context.allocator) -> bool {
destroyer(img)
} else {
assert(img.metadata == nil)
bytes.buffer_destroy(&img.pixels)
free(img)
}
return true