mirror of
				https://github.com/Z3Prover/z3
				synced 2025-10-31 19:52:29 +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
					
				
					 1 changed files with 5 additions and 1 deletions
				
			
		|  | @ -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…
	
	Add table
		Add a link
		
	
		Reference in a new issue