public override void CloseContainer ()
{
if ((caching_flags & Flags.CloseTypeCreated) != 0)
return;
// Close base type container first to avoid TypeLoadException
if (spec.BaseType != null) {
var btype = spec.BaseType.MemberDefinition as TypeContainer;
if (btype != null) {
btype.CloseContainer ();
if ((caching_flags & Flags.CloseTypeCreated) != 0)
return;
}
}
try {
caching_flags |= Flags.CloseTypeCreated;
TypeBuilder.CreateType ();
} catch (TypeLoadException) {
//
// This is fine, the code still created the type
//
} catch (Exception e) {
throw new InternalErrorException (this, e);
}
base.CloseContainer ();
containers = null;
initialized_fields = null;
initialized_static_fields = null;
type_bases = null;
OptAttributes = null;
}