[libpostgresql-jdbc-java] 68/93: #BUG# release cancelled timers to be garbage collected\ reported by zhangyuanchao at highgo.com.cn

Emmanuel Bourg ebourg-guest at moszumanska.debian.org
Mon Jan 9 10:18:53 UTC 2017


This is an automated email from the git hooks/post-receive script.

ebourg-guest pushed a commit to annotated tag REL9_3_1102
in repository libpostgresql-jdbc-java.

commit d867fe60beb850afa745eef34ae0ead2f2ef1772
Author: Dave Cramer <dave.cramer at credativ.ca>
Date:   Tue Feb 18 13:46:31 2014 +0000

    #BUG# release cancelled timers to be garbage collected\
    reported by zhangyuanchao at highgo.com.cn
---
 org/postgresql/Driver.java.in                    | 7 ++++++-
 org/postgresql/jdbc2/AbstractJdbc2Statement.java | 1 +
 2 files changed, 7 insertions(+), 1 deletion(-)

diff --git a/org/postgresql/Driver.java.in b/org/postgresql/Driver.java.in
index 4849266..e058be8 100644
--- a/org/postgresql/Driver.java.in
+++ b/org/postgresql/Driver.java.in
@@ -758,7 +758,12 @@ public class Driver implements java.sql.Driver
         throw notImplemented(this.getClass(), "getParentLogger()");
     }
 
- 	public synchronized  static void addTimerTask(TimerTask timerTask, long milliSeconds)
+    public static void purgeTimerTasks()
+    {
+        if ( cancelTimer != null ) cancelTimer.purge();
+    }
+
+    public synchronized  static void addTimerTask(TimerTask timerTask, long milliSeconds)
     {
 
     	if ( cancelTimer == null )
diff --git a/org/postgresql/jdbc2/AbstractJdbc2Statement.java b/org/postgresql/jdbc2/AbstractJdbc2Statement.java
index 7ca3c4f..bbc1937 100644
--- a/org/postgresql/jdbc2/AbstractJdbc2Statement.java
+++ b/org/postgresql/jdbc2/AbstractJdbc2Statement.java
@@ -3438,6 +3438,7 @@ public abstract class AbstractJdbc2Statement implements BaseStatement
         {
             cancelTimer.cancel();
             cancelTimer = null;
+	    Driver.purgeTimerTasks();
         }
             
     }

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-java/libpostgresql-jdbc-java.git



More information about the pkg-java-commits mailing list