Skip to content

Commit

Permalink
fix: memory leak of sync api (#100)
Browse files Browse the repository at this point in the history
fix: memory leak of sync api
  • Loading branch information
oyyd authored Oct 23, 2022
1 parent 7116824 commit aaa1950
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,9 @@ pub fn compress_sync(
options,
};
let output = encoder.compute()?;
encoder.resolve(env, output)
let ret = encoder.resolve(env, output);
encoder.finally(env)?;
ret
}

#[napi]
Expand Down Expand Up @@ -186,7 +188,9 @@ pub fn uncompress_sync(
options,
};
let output = decoder.compute()?;
decoder.resolve(env, output)
let ret = decoder.resolve(env, output);
decoder.finally(env)?;
ret
}

#[napi]
Expand Down

0 comments on commit aaa1950

Please sign in to comment.