safer backend release

This commit is contained in:
Dmitriy Ryajov 2024-02-09 18:52:24 -06:00
parent aec844309e
commit 002f68291e
No known key found for this signature in database
GPG Key ID: DA8C680CE7C657A4
1 changed files with 4 additions and 3 deletions

View File

@ -88,6 +88,10 @@ proc prove*[H](
var
backend: ptr CircomCompatCtx
defer:
if backend != nil:
backend.addr.releaseCircomCompat()
if initCircomCompat(
self.backendCfg,
addr backend) != ERR_OK or backend == nil:
@ -169,9 +173,6 @@ proc prove*[H](
if proofPtr != nil:
proofPtr.addr.releaseProof()
if backend != nil:
backend.addr.releaseCircomCompat()
success proof
proc verify*(