Skip to content

Commit

Permalink
Fix test failure.
Browse files Browse the repository at this point in the history
  • Loading branch information
jlaanstra committed Nov 6, 2023
1 parent 2445e5b commit 5bcbdc2
Showing 1 changed file with 6 additions and 23 deletions.
29 changes: 6 additions & 23 deletions src/cswinrt/code_writers.h
Original file line number Diff line number Diff line change
Expand Up @@ -1867,11 +1867,6 @@ private static % _% = new %("%.%", %.IID);
auto objrefname = w.write_temp("%", bind<write_objref_type_name>(classType));
w.write(R"(
private static volatile FactoryObjectReference<IActivationFactoryVftbl> __%;
private static FactoryObjectReference<IActivationFactoryVftbl> Make__%()
{
global::System.Threading.Interlocked.CompareExchange(ref __%, ActivationFactory.Get("%.%"), null);
return __%;
}
private static FactoryObjectReference<IActivationFactoryVftbl> %
{
get
Expand All @@ -1883,20 +1878,17 @@ private static FactoryObjectReference<IActivationFactoryVftbl> %
}
else
{
return Make__%();
return __% = ActivationFactory.Get("%.%");
}
}
}
)",
objrefname,
objrefname,
objrefname,
classType.TypeNamespace(),
classType.TypeName(),
objrefname,
objrefname,
objrefname,
objrefname);
classType.TypeNamespace(),
classType.TypeName());
}

void write_static_objref_definition(writer& w, std::string_view const& vftblType, TypeDef const& staticsType, TypeDef const& classType)
Expand Down Expand Up @@ -1933,11 +1925,6 @@ private static ObjectReference<%> % => __% ?? Make__%();
auto objrefname = w.write_temp("%", bind<write_objref_type_name>(staticsType));
w.write(R"(
private static volatile FactoryObjectReference<%> __%;
private static FactoryObjectReference<%> Make__%()
{
global::System.Threading.Interlocked.CompareExchange(ref __%, ActivationFactory.Get<%>("%.%", %.IID), null);
return __%;
}
private static FactoryObjectReference<%> %
{
get
Expand All @@ -1949,7 +1936,7 @@ private static FactoryObjectReference<%> %
}
else
{
return Make__%();
return __% = ActivationFactory.Get<%>("%.%", %.IID);
}
}
}
Expand All @@ -1959,15 +1946,11 @@ private static FactoryObjectReference<%> %
vftblType,
objrefname,
objrefname,
objrefname,
vftblType,
classType.TypeNamespace(),
classType.TypeName(),
bind<write_type_name>(staticsType, typedef_name_type::StaticAbiClass, true),
objrefname,
vftblType,
objrefname,
objrefname,
objrefname);
bind<write_type_name>(staticsType, typedef_name_type::StaticAbiClass, true));
}
}

Expand Down

0 comments on commit 5bcbdc2

Please sign in to comment.