Skip to content

Commit

Permalink
Update index.js
Browse files Browse the repository at this point in the history
Change indentation

Update index.js

Add try, finally
  • Loading branch information
123edi10 committed Nov 27, 2024
1 parent 00af796 commit cc18e69
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -219,9 +219,14 @@ class Runtime {
withRunnableArtThread(vm, env, thread => {
const collectClassHandles = makeArtClassVisitor(klass => {
const handle = addGlobalReference(vmHandle, thread, klass);
const className = env.getClassName(handle);
callbacks.onMatch(className, handle);
env.deleteGlobalRef(handle);
try {
const className = env.getClassName(handle);
callbacks.onMatch(className, handle);
env.deleteGlobalRef(handle);
}
finally {
env.deleteGlobalRef(handle);
}
return true;
});

Expand Down

0 comments on commit cc18e69

Please sign in to comment.