- Code: Select all
[0223/182019.775:FATAL:cef_ref_counted.h(325)] Assert failed: ptr_ != 0.
- Code: Select all
void UpdateLoadState(std::wstring text, int percent)
{
auto obj = browser->GetMainFrame()->GetV8Context()->GetGlobal()->GetValue("app")->GetValue("loadState");
if (text != L"") {
obj->SetValue("text", CefV8Value::CreateString(text), V8_PROPERTY_ATTRIBUTE_NONE);
}
if (percent != -1) {
obj->SetValue("percent", CefV8Value::CreateInt(percent), V8_PROPERTY_ATTRIBUTE_NONE);
}
CefV8ValueList arguments;
obj->GetValue("update")->ExecuteFunction(NULL, arguments);
}
The assert fails only when UpdateLoadState is executed from a std::thread so I've looked over the Wiki and found out that all V8 execution must take place on the main thread.
My question is: How could I use V8 in other threads?