Skip to content

Commit 70725f2

Browse files
committed
Fix milesibastos#11 - jTDS Memory Leak on WildFly 10.1 related to TimerThread
1 parent aae5f00 commit 70725f2

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/main/net/sourceforge/jtds/util/TimerThread.java

+4
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,10 @@ public static synchronized TimerThread getInstance() {
9797
public TimerThread() {
9898
// Set the thread name
9999
super("jTDS TimerThread");
100+
// Set contextClassLoader to library ClassLoader if possible
101+
try {
102+
this.setContextClassLoader(this.getClass().getClassLoader());
103+
} catch (SecurityException e) { }
100104
// Ensure that this thread does not prevent the VM from exiting
101105
this.setDaemon(true);
102106
}

0 commit comments

Comments
 (0)