Browse Source

Destroy pixel buffer

gingerBill 3 years ago
parent
commit
22dc020647
1 changed files with 2 additions and 0 deletions
  1. 2 0
      core/image/general_loader.odin

+ 2 - 0
core/image/general_loader.odin

@@ -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