[jboss-svn-commits] JBL Code SVN: r24495 - labs/jbossrules/trunk/drools-core/src/main/java/org/drools/reteoo.
jboss-svn-commits at lists.jboss.org
jboss-svn-commits at lists.jboss.org
Tue Dec 23 16:10:06 EST 2008
Author: tirelli
Date: 2008-12-23 16:10:06 -0500 (Tue, 23 Dec 2008)
New Revision: 24495
Modified:
labs/jbossrules/trunk/drools-core/src/main/java/org/drools/reteoo/ObjectTypeNode.java
labs/jbossrules/trunk/drools-core/src/main/java/org/drools/reteoo/ReteooWorkingMemory.java
Log:
JBRULES-1902: fixing leak on event garbage collection
Modified: labs/jbossrules/trunk/drools-core/src/main/java/org/drools/reteoo/ObjectTypeNode.java
===================================================================
--- labs/jbossrules/trunk/drools-core/src/main/java/org/drools/reteoo/ObjectTypeNode.java 2008-12-23 20:53:51 UTC (rev 24494)
+++ labs/jbossrules/trunk/drools-core/src/main/java/org/drools/reteoo/ObjectTypeNode.java 2008-12-23 21:10:06 UTC (rev 24495)
@@ -195,7 +195,7 @@
((EventFactHandle)factHandle).getStartTimestamp() + this.expirationOffset );
JobContext jobctx = new ExpireJobContext( expire,
workingMemory );
- JobHandle handle = clock.scheduleJob( new ExpireJob(),
+ JobHandle handle = clock.scheduleJob( job,
jobctx,
new PointInTimeTrigger( nextTimestamp ) );
jobctx.setJobHandle( handle );
Modified: labs/jbossrules/trunk/drools-core/src/main/java/org/drools/reteoo/ReteooWorkingMemory.java
===================================================================
--- labs/jbossrules/trunk/drools-core/src/main/java/org/drools/reteoo/ReteooWorkingMemory.java 2008-12-23 20:53:51 UTC (rev 24494)
+++ labs/jbossrules/trunk/drools-core/src/main/java/org/drools/reteoo/ReteooWorkingMemory.java 2008-12-23 21:10:06 UTC (rev 24495)
@@ -325,6 +325,12 @@
this.node.retractObject( factHandle,
context,
workingMemory );
+
+ // if no activations for this expired event
+ if( ((EventFactHandle)factHandle).getActivationsCount() == 0 ) {
+ // remove it from the object store and clean up resources
+ ((EventFactHandle)factHandle).getEntryPoint().retract( factHandle );
+ }
}
}
}
More information about the jboss-svn-commits
mailing list