Skip to content

Commit 4af0351

Browse files
Fix issue jacksondunstan#6 by ref counting System::String objects created from string literals
1 parent ac7bb11 commit 4af0351

1 file changed

Lines changed: 1 addition & 0 deletions

File tree

Unity/CppSource/NativeScript/Bindings.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1093,6 +1093,7 @@ namespace System
10931093
String::String(const char* chars)
10941094
: Object(Plugin::InternalUse::Only, Plugin::StringNew(chars))
10951095
{
1096+
Plugin::ReferenceManagedClass(Handle);
10961097
}
10971098

10981099
ICloneable::ICloneable(Plugin::InternalUse iu, int32_t handle)

0 commit comments

Comments
 (0)