2014-09-04 2 views
1

격리 범위 ("v8 :: Isolate :: Scope ..."를 통해)에서 "Isolate-> IdleNotification (100)"을 호출하고 "V8 : : GetCurrentPlatform() -> CallOnBackgroundThread (...) "가 V8에서 호출되면"V8 :: GetCurrentPlatform() "이 NULL을 반환하고 모든 것이 치명적인 사망으로 사망합니다. 현재 플랫폼이 null 일 수있는 이유는 무엇입니까? 또는 아니라 오히려, 그것이 아닌지 확인하기 위해 무엇을해야합니까? 다른 모든 것은 잘 작동하는 것 같습니다.V8 "플랫폼"이 null입니다

추가 세부 사항 : Visual Studio 2013을 사용하고 소스 코드를 컴파일하고 V8.Net 래퍼 (codeplex)와 함께 사용하는 결과 라이브러리를 컴파일합니다. 나는 유휴 알림 호출을 트리거하기 전에 다음 코드를 실행합니다 :

v8::Locker __lockScope(engine->Isolate()); 
v8::Isolate::Scope __isolateScope(engine->Isolate()); 
v8::HandleScope __handleScope(Isolate::GetCurrent()); 

내가 다른 조합을 시도, 그리고 단지 v8::Locker __lockScope이 필요 보이지만 플랫폼이 여전히 널;

v8::Platform* V8::GetCurrentPlatform() { 
    DCHECK(platform_); // <-- 'platform_' is NULL 
    return platform_; 
} 

답변

0

이 작업은 곧 완료되었지만 답변을 게시하는 것을 잊었습니다. 여기 있습니다 : Google은 물건을 변경했습니다 (깜짝! : /). 이제 플랫폼을 먼저 초기화해야합니다. 나는 이것을했고 모두 다시 작동합니다 :

v8::V8::InitializePlatform(v8::platform::CreateDefaultPlatform()); 
// Sets the v8::Platform to use. This should be invoked before V8 is initialized. 
v8::V8::InitializeICU(); 
// Initialize the ICU library bundled with V8. (if using the bundled ICU) 
v8::V8::Initialize(); 
// Initialize V8. 
관련 문제