mirror of
https://github.com/Z3Prover/z3
synced 2025-04-08 18:31:49 +00:00
Fixed nested user-propagator callbacks in .NET (#6307)
* Fixed nested user-propagator callbacks in .NET * Typo
This commit is contained in:
parent
e2f4fc2307
commit
a0ca5d745e
|
@ -71,6 +71,7 @@ namespace Microsoft.Z3
|
|||
Solver solver;
|
||||
Context ctx;
|
||||
Z3_solver_callback callback = IntPtr.Zero;
|
||||
int callbackNesting = 0;
|
||||
FixedEh fixed_eh;
|
||||
Action final_eh;
|
||||
EqEh eq_eh;
|
||||
|
@ -91,6 +92,7 @@ namespace Microsoft.Z3
|
|||
|
||||
void Callback(Action fn, Z3_solver_callback cb)
|
||||
{
|
||||
this.callbackNesting++;
|
||||
this.callback = cb;
|
||||
try
|
||||
{
|
||||
|
@ -102,7 +104,9 @@ namespace Microsoft.Z3
|
|||
}
|
||||
finally
|
||||
{
|
||||
this.callback = IntPtr.Zero;
|
||||
callbackNesting--;
|
||||
if (callbackNesting == 0) // callbacks can be nested (e.g., internalizing new element in "created")
|
||||
this.callback = IntPtr.Zero;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue