Skip to content

Commit 4cad8c5

Browse files
committed
Use a single instance of DefaultProxyFactoryFactory in AbstractBytecodeProvider
1 parent bf7e34d commit 4cad8c5

File tree

2 files changed

+5
-6
lines changed

2 files changed

+5
-6
lines changed

src/NHibernate/Bytecode/AbstractBytecodeProvider.cs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,8 @@ public virtual IProxyFactoryFactory ProxyFactoryFactory
2828
throw new HibernateByteCodeException("Failed to create an instance of '" + proxyFactoryFactory.FullName + "'!", e);
2929
}
3030
}
31-
return new DefaultProxyFactoryFactory();
31+
32+
return DefaultProxyFactoryFactory.Instance;
3233
}
3334
}
3435

@@ -116,4 +117,4 @@ public void SetCollectionTypeFactoryClass(System.Type type)
116117

117118
#endregion
118119
}
119-
}
120+
}

src/NHibernate/Bytecode/DefaultProxyFactoryFactory.cs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ namespace NHibernate.Bytecode
44
{
55
public class DefaultProxyFactoryFactory : IProxyFactoryFactory
66
{
7-
#region IProxyFactoryFactory Members
7+
internal static DefaultProxyFactoryFactory Instance = new DefaultProxyFactoryFactory();
88

99
public IProxyFactory BuildProxyFactory()
1010
{
@@ -25,7 +25,5 @@ public bool IsProxy(object entity)
2525
{
2626
return entity is INHibernateProxy;
2727
}
28-
29-
#endregion
3028
}
31-
}
29+
}

0 commit comments

Comments
 (0)