summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMark Wielaard <mark@klomp.org>2004-05-02 09:13:32 +0000
committerMark Wielaard <mark@klomp.org>2004-05-02 09:13:32 +0000
commite681542cc44babff3f29e120bd819b0b8bd6be99 (patch)
tree0f029e8bca2f2f2f60707c37f538d8217bb1cac4
parentb80f73774da5d87f58cecb3081abec8b6068f49d (diff)
downloadclasspath-e681542cc44babff3f29e120bd819b0b8bd6be99.tar.gz
* gnu/java/nio/channels/FileChannelImpl.java (finalize): New method.
-rw-r--r--ChangeLog4
-rw-r--r--gnu/java/nio/channels/FileChannelImpl.java8
2 files changed, 12 insertions, 0 deletions
diff --git a/ChangeLog b/ChangeLog
index 99fd3a3f6..4dcef7f56 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+2004-05-02 Mark Wielaard <mark@klomp.org>
+
+ * gnu/java/nio/channels/FileChannelImpl.java (finalize): New method.
+
2004-05-01 Mark Wielaard <mark@klomp.org>
* javax/swing/AbstractButton.java: Replace special HTML entities with
diff --git a/gnu/java/nio/channels/FileChannelImpl.java b/gnu/java/nio/channels/FileChannelImpl.java
index 2a27e1dd1..ef5f5d79a 100644
--- a/gnu/java/nio/channels/FileChannelImpl.java
+++ b/gnu/java/nio/channels/FileChannelImpl.java
@@ -131,6 +131,14 @@ public final class FileChannelImpl extends FileChannel
protected native void implCloseChannel() throws IOException;
+ /**
+ * Makes sure the Channel is properly closed.
+ */
+ protected void finalize() throws IOException
+ {
+ this.close();
+ }
+
public int read (ByteBuffer dst) throws IOException
{
int result;