We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent ccb7fb3 commit 6287f27Copy full SHA for 6287f27
src/com/danga/MemCached/SockIOPool.java
@@ -1858,5 +1858,25 @@ public int hashCode() {
1858
public String toString() {
1859
return ( sock == null ) ? "" : sock.toString();
1860
}
1861
+
1862
+ /**
1863
+ * Hack to reap any leaking children.
1864
+ */
1865
+ protected void finalize() throws Throwable {
1866
+ try {
1867
+ if ( sock != null ) {
1868
+ log.error( "++++ closing potentially leaked socket in finalize" );
1869
+ sock.close();
1870
+ sock = null;
1871
+ }
1872
1873
+ catch ( Throwable t ) {
1874
+ log.error( t.getMessage(), t );
1875
1876
1877
+ finally {
1878
+ super.finalize();
1879
1880
1881
1882
0 commit comments