Check that we own the validator before nulling it out

See gh-4734
This commit is contained in:
Dave Syer 2015-12-10 16:04:31 +00:00
parent 2d2e4eea82
commit fae14b409f
1 changed files with 1 additions and 1 deletions

View File

@ -205,7 +205,7 @@ public class ConfigurationPropertiesBindingPostProcessor
@Override
public void onApplicationEvent(ContextRefreshedEvent event) {
if (this.validator != null && isJsr303Present()) {
if (this.ownedValidator && this.validator != null && isJsr303Present()) {
this.validator = null; // allow it to be garbage collected
}
}