|
|
|
@ -17,7 +17,7 @@ using CppSharp.Generators.Cpp;
@@ -17,7 +17,7 @@ using CppSharp.Generators.Cpp;
|
|
|
|
|
|
|
|
|
|
namespace CppSharp |
|
|
|
|
{ |
|
|
|
|
public class Driver |
|
|
|
|
public class Driver : IDisposable |
|
|
|
|
{ |
|
|
|
|
public DriverOptions Options { get; private set; } |
|
|
|
|
public ParserOptions ParserOptions { get; set; } |
|
|
|
@ -399,6 +399,13 @@ namespace CppSharp
@@ -399,6 +399,13 @@ namespace CppSharp
|
|
|
|
|
Context.GeneratorOutputPasses.AddPass(pass); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
public void Dispose() |
|
|
|
|
{ |
|
|
|
|
Generator.Dispose(); |
|
|
|
|
Context.TargetInfo?.Dispose(); |
|
|
|
|
ParserOptions.Dispose(); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
private bool hasParsingErrors; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
@ -407,8 +414,8 @@ namespace CppSharp
@@ -407,8 +414,8 @@ namespace CppSharp
|
|
|
|
|
public static void Run(ILibrary library) |
|
|
|
|
{ |
|
|
|
|
var options = new DriverOptions(); |
|
|
|
|
var driver = new Driver(options); |
|
|
|
|
|
|
|
|
|
using (var driver = new Driver(options)) |
|
|
|
|
{ |
|
|
|
|
library.Setup(driver); |
|
|
|
|
|
|
|
|
|
driver.Setup(); |
|
|
|
@ -469,10 +476,7 @@ namespace CppSharp
@@ -469,10 +476,7 @@ namespace CppSharp
|
|
|
|
|
break; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
driver.Generator.Dispose(); |
|
|
|
|
driver.Context.TargetInfo.Dispose(); |
|
|
|
|
driver.ParserOptions.Dispose(); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|