GP-2739 fix release of temporary program instance when error cond

This commit is contained in:
dev747368
2022-10-20 18:14:41 +00:00
parent 4bb4683ba2
commit f6f39b610b
2 changed files with 7 additions and 8 deletions
@@ -180,14 +180,13 @@ public class DWARFAnalyzer extends AbstractAnalyzer {
return false;
}
DWARFSectionProvider dsp =
DWARFSectionProviderFactory.createSectionProviderFor(program, monitor); // closed by DWARFProgram
if (dsp == null) {
Msg.info(this, "Unable to find DWARF information, skipping DWARF analysis");
return false;
}
try (DWARFSectionProvider dsp =
DWARFSectionProviderFactory.createSectionProviderFor(program, monitor)) {
if (dsp == null) {
Msg.info(this, "Unable to find DWARF information, skipping DWARF analysis");
return false;
}
try {
try (DWARFProgram prog = new DWARFProgram(program, importOptions, monitor, dsp)) {
if (prog.getRegisterMappings() == null && importOptions.isImportFuncs()) {
log.appendMsg(
@@ -249,7 +249,7 @@ public class DWARFProgram implements Closeable {
@Override
public void close() throws IOException {
sectionProvider.close();
sectionProvider = null;
compUnits.clear();
debugAbbrBR = null;
debugInfoBR = null;