Skip to content

Commit 1b3cb97

Browse files
authored
Merge pull request #819 from NativeScript/pete/fix-gc-crash
Fix v8 GC Crash caused by incorrect usage of the internal V8 API
2 parents ebe6e74 + a621c46 commit 1b3cb97

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

runtime/src/main/jni/ObjectManager.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ ObjectManager::JSInstanceInfo* ObjectManager::GetJSInstanceInfo(const Local<Obje
109109
}
110110

111111
bool ObjectManager::IsJsRuntimeObject(const v8::Local<v8::Object>& object) {
112-
int internalFieldCount = NativeScriptExtension::GetInternalFieldCount(object);
112+
int internalFieldCount = object->InternalFieldCount();
113113
const int count = static_cast<int>(MetadataNodeKeys::END);
114114
return internalFieldCount == count;
115115
}

runtime/src/main/jni/include/V8NativeScriptExtension.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,10 @@ namespace v8 {
1414

1515
static v8::Local<v8::Array> GetPropertyKeys(v8::Isolate *isolate, const v8::Local<v8::Context>& context, const v8::Local<v8::Object>& object, bool& success);
1616

17+
/*
18+
* Deprecated. Use V8 Object.InternalFieldCount() instead.
19+
* TODO: Pete: remove in following 6.x update
20+
*/
1721
static int GetInternalFieldCount(const v8::Local<v8::Object>& object);
1822

1923
static void CpuFeaturesProbe(bool cross_compile);

0 commit comments

Comments
 (0)