From 67fe9a6b81e9c260353f644f5cb3848a2de8bbe1 Mon Sep 17 00:00:00 2001 From: Mark Robert Miller Date: Mon, 26 Sep 2011 02:13:23 +0000 Subject: [PATCH] SOLR-2793: Be sure to only dec ref if we inc ref'd git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@1175646 13f79535-47bb-0310-9956-ffa450edef68 --- solr/core/src/java/org/apache/solr/core/SolrCore.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/solr/core/src/java/org/apache/solr/core/SolrCore.java b/solr/core/src/java/org/apache/solr/core/SolrCore.java index 1bbfa7423a9..cd964268d92 100644 --- a/solr/core/src/java/org/apache/solr/core/SolrCore.java +++ b/solr/core/src/java/org/apache/solr/core/SolrCore.java @@ -1268,7 +1268,7 @@ public final class SolrCore implements SolrInfoMBean { ); } catch(Exception e) { // if submit fails, newSearchHolder does not get decref'd - if (newSearchHolder != null) newSearchHolder.decref(); + if (returnSearcher && newSearchHolder != null) newSearchHolder.decref(); throw e; } }