diff --git a/lib/jpegtran_ffi.dart b/lib/jpegtran_ffi.dart index a5eb75a..8485fad 100644 --- a/lib/jpegtran_ffi.dart +++ b/lib/jpegtran_ffi.dart @@ -280,7 +280,15 @@ class JpegTransformer { void dispose() { calloc.free(_jpegBuf); - int res = _bindings.tjDestroy(_handleTransform); + int res = _bindings.tjDestroy(_handleCompress); + if (res != 0) { + throw Exception("tjDestroy failed"); + } + res = _bindings.tjDestroy(_handleDecompress); + if (res != 0) { + throw Exception("tjDestroy failed"); + } + res = _bindings.tjDestroy(_handleTransform); if (res != 0) { throw Exception("tjDestroy failed"); } diff --git a/libjpeg-turbo b/libjpeg-turbo index ab6c4a5..7fa4b5b 160000 --- a/libjpeg-turbo +++ b/libjpeg-turbo @@ -1 +1 @@ -Subproject commit ab6c4a5db10901fa2ae9e8594768175e02b6e016 +Subproject commit 7fa4b5b762c9a99b46b0b7838f5fd55071b92ea5