otherwise it can happen that the dummy string is allocated in a
different domain, and when it's onloaded the GC root points to an
invalid object.
/* to make it work with our special string constructors */
if (!string_dummy) {
+ MonoError error;
MONO_GC_REGISTER_ROOT_SINGLE (string_dummy, MONO_ROOT_SOURCE_MARSHAL, "dummy marshal string");
- string_dummy = mono_string_new_wrapper ("dummy");
+ string_dummy = mono_string_new_checked (mono_get_root_domain (), "dummy", &error);
+ mono_error_assert_ok (&error);
}
if (virtual_) {