I'm writing a plugin API for my app, using JSContext
and evaluateScript
.
Everything works fine, but releasing the context is has turned out to be somewhat impossible, especially when using asynchronous methods, such as sheets and modals.
Is there a way to detect when JSContext
is done evaluating the script? I can't find any properties for it and it has no delegate, so I can't detect it some timer loop either. I've tried browsing through the documentation, but haven't found anything useful.
evaluateScript
does return JSValue
, but it doesn't help here, as it's returned synchronously.
question from:
https://stackoverflow.com/questions/65848676/release-jscontext-when-evaluation-ends 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…