Skip to content

Commit

Permalink
HSEARCH-3132 Close normalizers on shutdown
Browse files Browse the repository at this point in the history
  • Loading branch information
yrodiere committed Apr 19, 2018
1 parent 40ebd91 commit 1476228
Showing 1 changed file with 5 additions and 1 deletion.
Expand Up @@ -7,6 +7,7 @@
package org.hibernate.search.engine.impl;

import org.hibernate.search.engine.integration.impl.SearchIntegration;
import org.hibernate.search.util.impl.Closer;

/**
* @author Yoann Rodiere
Expand Down Expand Up @@ -36,7 +37,10 @@ public NormalizerRegistry getNormalizerRegistry() {

@Override
public void close() {
analyzerRegistry.close();
try ( Closer<RuntimeException> closer = new Closer<>() ) {
closer.push( AnalyzerRegistry::close, analyzerRegistry );
closer.push( NormalizerRegistry::close, normalizerRegistry );
}
}

}

0 comments on commit 1476228

Please sign in to comment.