mirror of
https://github.com/Z3Prover/z3
synced 2025-09-10 11:41:25 +00:00
Dispose of intermediate Z3Objects created in dotnet api. (#5901)
* Dispose of intermediate Z3Objects created in dotnet api. * Set C# LangVersion to 8.0. * Fix build errors. * Fix warning about empty using statement. * Fix Xor to only dispose of objects that it creates internally.
This commit is contained in:
parent
bdf7de1703
commit
4e0a2f5968
13 changed files with 360 additions and 142 deletions
|
@ -255,7 +255,7 @@ namespace Microsoft.Z3
|
|||
get
|
||||
{
|
||||
|
||||
ASTVector av = new ASTVector(Context, Native.Z3_fixedpoint_get_rules(Context.nCtx, NativeObject));
|
||||
using ASTVector av = new ASTVector(Context, Native.Z3_fixedpoint_get_rules(Context.nCtx, NativeObject));
|
||||
return av.ToBoolExprArray();
|
||||
}
|
||||
}
|
||||
|
@ -268,7 +268,7 @@ namespace Microsoft.Z3
|
|||
get
|
||||
{
|
||||
|
||||
ASTVector av = new ASTVector(Context, Native.Z3_fixedpoint_get_assertions(Context.nCtx, NativeObject));
|
||||
using ASTVector av = new ASTVector(Context, Native.Z3_fixedpoint_get_assertions(Context.nCtx, NativeObject));
|
||||
return av.ToBoolExprArray();
|
||||
}
|
||||
}
|
||||
|
@ -292,7 +292,7 @@ namespace Microsoft.Z3
|
|||
/// </summary>
|
||||
public BoolExpr[] ParseFile(string file)
|
||||
{
|
||||
ASTVector av = new ASTVector(Context, Native.Z3_fixedpoint_from_file(Context.nCtx, NativeObject, file));
|
||||
using ASTVector av = new ASTVector(Context, Native.Z3_fixedpoint_from_file(Context.nCtx, NativeObject, file));
|
||||
return av.ToBoolExprArray();
|
||||
}
|
||||
|
||||
|
@ -301,7 +301,7 @@ namespace Microsoft.Z3
|
|||
/// </summary>
|
||||
public BoolExpr[] ParseString(string s)
|
||||
{
|
||||
ASTVector av = new ASTVector(Context, Native.Z3_fixedpoint_from_string(Context.nCtx, NativeObject, s));
|
||||
using ASTVector av = new ASTVector(Context, Native.Z3_fixedpoint_from_string(Context.nCtx, NativeObject, s));
|
||||
return av.ToBoolExprArray();
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue