[pbm] Fixes.

This commit is contained in:
Jeroen van Rijn
2022-04-30 21:00:32 +02:00
parent 234d529867
commit 8bd16c32f3
3 changed files with 64 additions and 62 deletions
+3 -2
View File
@@ -6,15 +6,16 @@ import "core:image"
destroy :: proc(img: ^image.Image) -> bool {
if img == nil do return false
defer free(img)
bytes.buffer_destroy(&img.pixels)
//! TEMP CAST
info, ok := img.metadata.(^image.Netpbm_Info)
if !ok do return false
bytes.buffer_destroy(&img.pixels)
header_destroy(&info.header)
free(info)
img.metadata = nil
free(img)
return true
}