mirror of
https://github.com/Ed94/Odin.git
synced 2026-08-06 15:48:51 +00:00
Destroy pixel buffer
This commit is contained in:
@@ -2,6 +2,7 @@ package image
|
|||||||
|
|
||||||
import "core:mem"
|
import "core:mem"
|
||||||
import "core:os"
|
import "core:os"
|
||||||
|
import "core:bytes"
|
||||||
|
|
||||||
Loader_Proc :: #type proc(data: []byte, options: Options, allocator: mem.Allocator) -> (img: ^Image, err: Error)
|
Loader_Proc :: #type proc(data: []byte, options: Options, allocator: mem.Allocator) -> (img: ^Image, err: Error)
|
||||||
Destroy_Proc :: #type proc(img: ^Image)
|
Destroy_Proc :: #type proc(img: ^Image)
|
||||||
@@ -54,6 +55,7 @@ destroy :: proc(img: ^Image, allocator := context.allocator) -> bool {
|
|||||||
destroyer(img)
|
destroyer(img)
|
||||||
} else {
|
} else {
|
||||||
assert(img.metadata == nil)
|
assert(img.metadata == nil)
|
||||||
|
bytes.buffer_destroy(&img.pixels)
|
||||||
free(img)
|
free(img)
|
||||||
}
|
}
|
||||||
return true
|
return true
|
||||||
|
|||||||
Reference in New Issue
Block a user