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; return false;
} }
DWARFSectionProvider dsp = try (DWARFSectionProvider dsp =
DWARFSectionProviderFactory.createSectionProviderFor(program, monitor); // closed by DWARFProgram DWARFSectionProviderFactory.createSectionProviderFor(program, monitor)) {
if (dsp == null) { if (dsp == null) {
Msg.info(this, "Unable to find DWARF information, skipping DWARF analysis"); Msg.info(this, "Unable to find DWARF information, skipping DWARF analysis");
return false; return false;
} }
try {
try (DWARFProgram prog = new DWARFProgram(program, importOptions, monitor, dsp)) { try (DWARFProgram prog = new DWARFProgram(program, importOptions, monitor, dsp)) {
if (prog.getRegisterMappings() == null && importOptions.isImportFuncs()) { if (prog.getRegisterMappings() == null && importOptions.isImportFuncs()) {
log.appendMsg( log.appendMsg(
@@ -249,7 +249,7 @@ public class DWARFProgram implements Closeable {
@Override @Override
public void close() throws IOException { public void close() throws IOException {
sectionProvider.close(); sectionProvider = null;
compUnits.clear(); compUnits.clear();
debugAbbrBR = null; debugAbbrBR = null;
debugInfoBR = null; debugInfoBR = null;