Browse Source

Deleted a useless weak reference thus simplifying TranslationUnit.

Signed-off-by: Dimitar Dobrev <dpldobrev@protonmail.com>
pull/778/head
Dimitar Dobrev 9 years ago
parent
commit
935c580465
  1. 11
      src/AST/TranslationUnit.cs

11
src/AST/TranslationUnit.cs

@ -1,4 +1,3 @@ @@ -1,4 +1,3 @@
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
@ -25,15 +24,11 @@ namespace CppSharp.AST @@ -25,15 +24,11 @@ namespace CppSharp.AST
/// Contains the macros present in the unit.
public List<MacroDefinition> Macros;
public Module Module
{
get { return (module != null) ? (Module) module.Target : null; }
set { module = new WeakReference(value); }
}
public Module Module { get; set; }
public bool IsSystemHeader { get; set; }
public bool IsValid { get { return FilePath != "<invalid>"; } }
public bool IsValid => FilePath != "<invalid>";
/// Contains the path to the file.
public string FilePath;
@ -83,8 +78,6 @@ namespace CppSharp.AST @@ -83,8 +78,6 @@ namespace CppSharp.AST
}
}
private WeakReference module;
public override T Visit<T>(IDeclVisitor<T> visitor)
{
return visitor.VisitTranslationUnit(this);

Loading…
Cancel
Save