Having problems with building or using CEF's C/C++ APIs? This forum is here to help. Please do not post bug reports or feature requests here.
by zhengtong0898 » Thu Mar 19, 2020 10:28 am
- Code: Select all
#include "include/base/cef_bind.h"
#include "include/wrapper/cef_closure_task.h"
void refresh_jsexecute(CefRefPtr<CefBrowser> browser) {
browser->GetMainFrame()->ExecuteJavaScript("location.reload();", CefString(), 0);
}
{
CefPostDelayedTask(TID_UI, base::Bind(&refresh_jsexecute, browser), 10000); // refresh / 10 sec
}
Error info: FATAL:browser_main.cc(219)] Check failed: global_request_context_->HasOneRef().
-
zhengtong0898
- Newbie
-
- Posts: 5
- Joined: Fri Feb 21, 2020 10:34 am
by zhengtong0898 » Thu Mar 19, 2020 11:43 am
solved.
change `void refresh_jsexecute(CefRefPtr<CefBrowser> browser)` to `void refresh_jsexecute(int index_browser)`
- Code: Select all
void refresh_jsexecute(int index_browser) {
if (!client_handler) return void();
CefRefPtr<CefBrowser> browser = client_handler->GetBrowserByIndex(index_browser);
browser->GetMainFrame()->ExecuteJavaScript("location.reload();", CefString(), 0);
}
-
zhengtong0898
- Newbie
-
- Posts: 5
- Joined: Fri Feb 21, 2020 10:34 am
Return to Support Forum
Who is online
Users browsing this forum: Google [Bot], Majestic-12 [Bot] and 62 guests