jena-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From d..@apache.org
Subject [2/4] jena git commit: Resolve memory leak
Date Thu, 06 Oct 2016 13:57:23 GMT
Resolve memory leak

Unregister ConsumerChoicePointFrame from Generator consumerCP uppon
closing


Project: http://git-wip-us.apache.org/repos/asf/jena/repo
Commit: http://git-wip-us.apache.org/repos/asf/jena/commit/da6fff46
Tree: http://git-wip-us.apache.org/repos/asf/jena/tree/da6fff46
Diff: http://git-wip-us.apache.org/repos/asf/jena/diff/da6fff46

Branch: refs/heads/master
Commit: da6fff46b3383335bf58abe5e25f51cde8ebd51e
Parents: 1b49b03
Author: Jérémie Fraudeau <jeremie.fraudeau@laposte.net>
Authored: Thu Sep 29 23:28:13 2016 +0200
Committer: Jérémie Fraudeau <jeremie.fraudeau@laposte.net>
Committed: Thu Sep 29 23:28:13 2016 +0200

----------------------------------------------------------------------
 .../jena/reasoner/rulesys/impl/ConsumerChoicePointFrame.java  | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/jena/blob/da6fff46/jena-core/src/main/java/org/apache/jena/reasoner/rulesys/impl/ConsumerChoicePointFrame.java
----------------------------------------------------------------------
diff --git a/jena-core/src/main/java/org/apache/jena/reasoner/rulesys/impl/ConsumerChoicePointFrame.java
b/jena-core/src/main/java/org/apache/jena/reasoner/rulesys/impl/ConsumerChoicePointFrame.java
index a1c2c26..cf662c2 100644
--- a/jena-core/src/main/java/org/apache/jena/reasoner/rulesys/impl/ConsumerChoicePointFrame.java
+++ b/jena-core/src/main/java/org/apache/jena/reasoner/rulesys/impl/ConsumerChoicePointFrame.java
@@ -164,8 +164,11 @@ public class ConsumerChoicePointFrame extends GenericTripleMatchFrame
     @Override
     public void close() {    	
     	super.close();
-    	if (generator != null && generator.interpreter != null) {
-    		generator.interpreter.close();
+    	if (generator != null) {
+            if(generator.interpreter != null) {
+                generator.interpreter.close();
+            }
+            generator.removeConsumer(this);
     		// .. but NOT 
     		//generator.setComplete();
     		// as it seems to cause other tests to fail


Mime
View raw message