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 e13f8ab commit 58ad42cCopy full SHA for 58ad42c
module/src/CScriptRuntimeInfo.h
@@ -17,14 +17,14 @@ class CScriptRuntimeInfo
17
18
public:
19
v8::Isolate* GetIsolate() {
20
- if (!isolates.Find(std::this_thread::get_id()))
+ auto isolate = isolates.GetElement(std::this_thread::get_id());
21
+ if (!isolate)
22
{
- Log::Colored << "NOT FOUND" << std::this_thread::get_id() << Log::Endl;
23
- v8::Isolate* isolate = MakeIsolate();
24
- isolates.Insert(std::this_thread::get_id(), isolate);
25
- return isolate;
+ v8::Isolate* newIsolate = MakeIsolate();
+ isolates.Insert(std::this_thread::get_id(), newIsolate);
+ return newIsolate;
26
}
27
- return isolates.GetElement(std::this_thread::get_id()).value_or(nullptr);
+ return *isolate;
28
29
30
v8::Isolate* MakeIsolate()
0 commit comments