Skip to content

Commit

Permalink
Call setInstance after api call
Browse files Browse the repository at this point in the history
  • Loading branch information
with-heart committed Nov 7, 2023
1 parent b2665f6 commit ff87028
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/magick-image.ts
Original file line number Diff line number Diff line change
Expand Up @@ -834,9 +834,8 @@ export class MagickImage extends NativeInstance implements IMagickImage {
return Pointer.use((objects) => {
try {
const instance = ImageMagick._api._MagickImage_ConnectedComponents(this._instance, settings.connectivity, objects.ptr, exception.ptr);
const colormapSize = ImageMagick._api._MagickImage_ColormapSize_Get(instance, exception.ptr);

return ConnectedComponent._create(objects.value, colormapSize);
this._setInstance(instance, exception)
return ConnectedComponent._create(objects.value, this.colormapSize);
} finally {
if (objects.value !== 0) {
ImageMagick._api._ConnectedComponent_DisposeList(objects.value);
Expand Down

0 comments on commit ff87028

Please sign in to comment.