Properly handle Kotlin from Objective-C allocations. (#2934)

This commit is contained in:
Nikolay Igotti
2019-04-30 18:22:13 +03:00
committed by GitHub
parent e62bcea97f
commit 07add87d7b
+3 -3
View File
@@ -169,9 +169,9 @@ static void initializeObjCExport();
format:@"%s must be allocated and initialized with a factory method",
class_getName(object_getClass(self))];
}
AllocInstanceWithAssociatedObject(typeInfo, result, result->refHolder.slotToInit());
ObjHolder holder;
AllocInstanceWithAssociatedObject(typeInfo, result, holder.slot());
UpdateHeapRef(result->refHolder.slotToInit(), holder.obj());
return result;
}