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/png | |
| parent | 4e080057fb0f24e66bb6ad4eccb931f1f325da9b (diff) | |
Add `destroy` with loader
Diffstat (limited to 'core/image/png')
| -rw-r--r-- | core/image/png/png.odin | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/core/image/png/png.odin b/core/image/png/png.odin index f91ad2b66..ea888d0ad 100644 --- a/core/image/png/png.odin +++ b/core/image/png/png.odin @@ -344,8 +344,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 } } @@ -1642,5 +1641,5 @@ load :: proc{load_from_file, load_from_bytes, load_from_context} @(init, private) _register :: proc() { - image.register_loader(.PNG, load_from_bytes) + image.register(.PNG, load_from_bytes, destroy) }
\ No newline at end of file |