fix: crash in utilityProcess when generating code from strings (#38014)
This commit is contained in:
parent
f12e12b341
commit
0240f6664e
14 changed files with 72 additions and 48 deletions
|
@ -7,6 +7,7 @@
|
|||
#include "base/cxx17_backports.h"
|
||||
#include "content/public/browser/browser_thread.h"
|
||||
#include "gin/dictionary.h"
|
||||
#include "shell/common/process_util.h"
|
||||
|
||||
namespace gin_helper {
|
||||
|
||||
|
@ -70,7 +71,7 @@ void CallTranslater(v8::Local<v8::External> external,
|
|||
struct DeleteOnUIThread {
|
||||
template <typename T>
|
||||
static void Destruct(const T* x) {
|
||||
if (gin_helper::Locker::IsBrowserProcess() &&
|
||||
if (electron::IsBrowserProcess() &&
|
||||
!content::BrowserThread::CurrentlyOn(content::BrowserThread::UI)) {
|
||||
content::BrowserThread::DeleteSoon(content::BrowserThread::UI, FROM_HERE,
|
||||
x);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue