Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
187 views
in Technique[技术] by (71.8m points)

objective c - Release JSContext when evaluation ends

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

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)
Waitting for answers

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

2.1m questions

2.1m answers

60 comments

57.0k users

...