Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mono/linker.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTautvydas Žilys <tautvydas.zilys@gmail.com>2018-04-30 22:39:27 +0300
committerMarek Safar <marek.safar@gmail.com>2018-05-01 00:12:40 +0300
commit5b6fd2eba198798fb60f07807c79ea874ce225aa (patch)
tree173d0ab1095090e8f7f01ef2e37ddd7761e3e11e
parentd50c2cb368dba2da7b07d0a56d7e545cf18280f1 (diff)
Fix PDB handle leak in the linker.
-rw-r--r--linker/Linker/LinkContext.cs9
1 files changed, 8 insertions, 1 deletions
diff --git a/linker/Linker/LinkContext.cs b/linker/Linker/LinkContext.cs
index 0ea723142..547a3e7ca 100644
--- a/linker/Linker/LinkContext.cs
+++ b/linker/Linker/LinkContext.cs
@@ -245,8 +245,15 @@ namespace Mono.Linker {
if (symbolReader == null)
return;
+ try {
+ assembly.MainModule.ReadSymbols (symbolReader);
+ } catch {
+ symbolReader.Dispose ();
+ return;
+ }
+
+ // Add symbol reader to annotations only if we have successfully read it
_annotations.AddSymbolReader (assembly, symbolReader);
- assembly.MainModule.ReadSymbols (symbolReader);
} catch { }
}