Skip to content
This repository has been archived by the owner on Oct 1, 2023. It is now read-only.

Commit

Permalink
Fixed potential unended transaction
Browse files Browse the repository at this point in the history
  • Loading branch information
Andrew Strelsky committed May 12, 2021
1 parent 3ead0e9 commit fab719e
Showing 1 changed file with 7 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -128,8 +128,9 @@ public final boolean isAbstract() {
@Override
public GhidraClass getGhidraClass() {
if (!(namespace instanceof GhidraClass)) {
Integer id = null;
boolean success = false;
try {
Integer id = null;
if (program.getCurrentTransaction() == null) {
id = program.startTransaction("creating GhidraClass for "+getName());
}
Expand All @@ -139,12 +140,14 @@ public GhidraClass getGhidraClass() {
namespace = TypeInfoUtils.getNamespaceFromTypeName(program, typeName);
namespace = NamespaceUtils.convertNamespaceToClass(namespace);
}
if (id != null) {
program.endTransaction(id, true);
}
success = true;
} catch (InvalidInputException e) {
Msg.error(this, e);
return null;
} finally {
if (id != null) {
program.endTransaction(id, success);
}
}
} return (GhidraClass) namespace;
}
Expand Down

0 comments on commit fab719e

Please sign in to comment.