8000
We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 7bae209 commit 90e282fCopy full SHA for 90e282f
fibjs/include/Isolate.h
@@ -75,6 +75,7 @@ class Isolate : public exlib::linkitem {
75
static Isolate* main();
76
77
static Isolate* current();
78
+ static Isolate* safe_current();
79
80
static Isolate* current(v8::Isolate* v8_isolate)
81
{
fibjs/src/base/Isolate.cpp
@@ -193,6 +193,15 @@ Isolate* Isolate::current()
193
return rt->isolate();
194
}
195
196
+Isolate* Isolate::safe_current()
197
+{
198
+ Runtime* rt = Runtime::current();
199
+ if (rt == NULL)
200
+ return NULL;
201
+
202
+ return rt->safe_isolate();
203
+}
204
205
Isolate* Isolate::main()
206
207
return s_isolates.head();
0 commit comments