File tree Expand file tree Collapse file tree 3 files changed +17
-3
lines changed
cpp/autobuilder/Semmle.Autobuild.Cpp Expand file tree Collapse file tree 3 files changed +17
-3
lines changed Original file line number Diff line number Diff line change @@ -17,7 +17,7 @@ static int Main()
17
17
try
18
18
{
19
19
Console . WriteLine ( "CodeQL C++ autobuilder" ) ;
20
- var builder = new CppAutobuilder ( actions , options ) ;
20
+ using var builder = new CppAutobuilder ( actions , options ) ;
21
21
return builder . AttemptBuild ( ) ;
22
22
}
23
23
catch ( InvalidEnvironmentException ex )
Original file line number Diff line number Diff line change @@ -17,7 +17,7 @@ public static int Main()
17
17
try
18
18
{
19
19
Console . WriteLine ( "CodeQL C# autobuilder" ) ;
20
- var builder = new CSharpAutobuilder ( actions , options ) ;
20
+ using var builder = new CSharpAutobuilder ( actions , options ) ;
21
21
return builder . AttemptBuild ( ) ;
22
22
}
23
23
catch ( InvalidEnvironmentException ex )
Original file line number Diff line number Diff line change @@ -92,7 +92,7 @@ public interface IAutobuilder<out TAutobuildOptions> where TAutobuildOptions : A
92
92
/// The overall design is intended to be extensible so that in theory,
93
93
/// it should be possible to add new build rules without touching this code.
94
94
/// </summary>
95
- public abstract class Autobuilder < TAutobuildOptions > : IAutobuilder < TAutobuildOptions > where TAutobuildOptions : AutobuildOptionsShared
95
+ public abstract class Autobuilder < TAutobuildOptions > : IDisposable , IAutobuilder < TAutobuildOptions > where TAutobuildOptions : AutobuildOptionsShared
96
96
{
97
97
/// <summary>
98
98
/// Full file paths of files found in the project directory, as well as
@@ -351,6 +351,20 @@ protected BuildScript AutobuildFailure() =>
351
351
}
352
352
} ) ;
353
353
354
+ public void Dispose ( )
355
+ {
356
+ Dispose ( true ) ;
357
+ GC . SuppressFinalize ( this ) ;
358
+ }
359
+
360
+ protected virtual void Dispose ( bool disposing )
361
+ {
362
+ if ( disposing )
363
+ {
364
+ ( diagnostics as IDisposable ) ? . Dispose ( ) ;
365
+ }
366
+ }
367
+
354
368
/// <summary>
355
369
/// Value of CODEQL_EXTRACTOR_<LANG>_ROOT environment variable.
356
370
/// </summary>
You can’t perform that action at this time.
0 commit comments