3
0
Fork 0
mirror of https://github.com/Z3Prover/z3 synced 2025-06-14 18:06:15 +00:00

Java API context deletion concurrency fix.

Relates to #205 #245
This commit is contained in:
Christoph M. Wintersteiger 2015-10-14 22:13:43 +01:00
parent a71a333722
commit ef80645a71

View file

@ -3809,14 +3809,16 @@ public class Context extends IDisposable
m_intSort = null; m_intSort = null;
m_realSort = null; m_realSort = null;
if (m_refCount.get() == 0 && m_ctx != 0) { synchronized (creation_lock) {
try { if (m_refCount.get() == 0 && m_ctx != 0) {
Native.delContext(m_ctx); try {
} catch (Z3Exception e) { Native.delContext(m_ctx);
// OK? } catch (Z3Exception e) {
System.out.println("Context deletion failed; memory leak possible."); // OK?
System.out.println("Context deletion failed; memory leak possible.");
}
m_ctx = 0;
} }
m_ctx = 0;
} }
} }
} }