HHH-8502 synchronize AuditConfiguration#destroy

This commit is contained in:
Brett Meyer 2013-09-25 14:22:37 -04:00
parent a20b0bd9ea
commit c28748f989
1 changed files with 6 additions and 4 deletions

View File

@ -187,10 +187,12 @@ public class AuditConfiguration {
}
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;