Merge "MTP: Add try/finally handling to finalize overrides"

This commit is contained in:
Mike Lockwood
2010-08-30 08:59:21 -07:00
committed by Android (Google) Code Review
4 changed files with 24 additions and 7 deletions

View File

@@ -41,8 +41,12 @@ public class MtpClient {
}
@Override
protected void finalize() {
native_finalize();
protected void finalize() throws Throwable {
try {
native_finalize();
} finally {
super.finalize();
}
}
public boolean start() {

View File

@@ -97,7 +97,11 @@ public final class MtpCursor extends AbstractWindowedCursor {
@Override
protected void finalize() {
native_finalize();
try {
native_finalize();
} finally {
super.finalize();
}
}
@Override

View File

@@ -86,8 +86,13 @@ public class MtpDatabase {
}
@Override
protected void finalize() {
native_finalize();
protected void finalize() throws Throwable {
try {
native_finalize();
mDevicePropDb.close();
} finally {
super.finalize();
}
}
private int beginSendObject(String path, int format, int parent,

View File

@@ -35,8 +35,12 @@ public class MtpServer {
}
@Override
protected void finalize() {
native_finalize();
protected void finalize() throws Throwable {
try {
native_finalize();
} finally {
super.finalize();
}
}
public void start() {