HHH-8502 synchronize AuditConfiguration#destroy

This commit is contained in:
Brett Meyer 2013-09-25 14:21:15 -04:00
parent 3be247023b
commit c31d9d3213

View File

@ -185,10 +185,12 @@ public synchronized static AuditConfiguration getFor(Configuration cfg, ClassLoa
}
public void destroy() {
for ( Map.Entry<Configuration, AuditConfiguration> c : new HashSet<Map.Entry<Configuration, AuditConfiguration>>(
cfgs.entrySet() ) ) {
if ( c.getValue() == this ) { // this is nasty cleanup fix, whole static CFGS should be reworked
cfgs.remove( c.getKey() );
synchronized ( AuditConfiguration.class ) {
for ( Map.Entry<Configuration, AuditConfiguration> c : new HashSet<Map.Entry<Configuration, AuditConfiguration>>(
cfgs.entrySet() ) ) {
if ( c.getValue() == this ) { // this is nasty cleanup fix, whole static CFGS should be reworked
cfgs.remove( c.getKey() );
}
}
}
classLoaderService = null;