diff options
| author | gingerBill <bill@gingerbill.org> | 2022-05-14 15:06:55 +0100 |
|---|---|---|
| committer | gingerBill <bill@gingerbill.org> | 2022-05-14 15:06:55 +0100 |
| commit | 3aa0a733f3b59388ae320f07cfabb1f4e7f0cec2 (patch) | |
| tree | 6bea56d06b07eca6e098644153e11e4a6421f8b8 /core/image/qoi | |
| parent | 4e080057fb0f24e66bb6ad4eccb931f1f325da9b (diff) | |
Add `destroy` with loader
Diffstat (limited to 'core/image/qoi')
| -rw-r--r-- | core/image/qoi/qoi.odin | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/core/image/qoi/qoi.odin b/core/image/qoi/qoi.odin index 884f4963b..f10f2ff56 100644 --- a/core/image/qoi/qoi.odin +++ b/core/image/qoi/qoi.odin @@ -198,8 +198,7 @@ load_from_file :: proc(filename: string, options := Options{}, allocator := cont if ok {
return load_from_bytes(data, options)
} else {
- img = new(Image)
- return img, .Unable_To_Read_File
+ return nil, .Unable_To_Read_File
}
}
@@ -407,5 +406,5 @@ qoi_hash :: #force_inline proc(pixel: RGBA_Pixel) -> (index: u8) { @(init, private)
_register :: proc() {
- image.register_loader(.QOI, load_from_bytes)
+ image.register(.QOI, load_from_bytes, destroy)
}
\ No newline at end of file |