LocationManagerService: Add null pointer check and remove useless finalize() method.

Change-Id: I4017d38a1bea7564a85575486a7c2aef569dfe5d
Signed-off-by: Mike Lockwood <lockwood@android.com>
This commit is contained in:
Mike Lockwood
2009-09-01 07:26:56 -04:00
parent 2bd4326a46
commit 3a76fd6279

View File

@@ -854,7 +854,9 @@ public class LocationManagerService extends ILocationManager.Stub implements Run
*/
void disposeLocked() {
ArrayList<UpdateRecord> records = mRecordsByProvider.get(this.mProvider);
records.remove(this);
if (records != null) {
records.remove(this);
}
}
@Override
@@ -873,15 +875,6 @@ public class LocationManagerService extends ILocationManager.Stub implements Run
mLastFixBroadcast.dump(new PrintWriterPrinter(pw), prefix + " ");
pw.println(prefix + "mLastStatusBroadcast=" + mLastStatusBroadcast);
}
/**
* Calls dispose().
*/
@Override protected void finalize() {
synchronized (mLock) {
disposeLocked();
}
}
}
private Receiver getReceiver(ILocationListener listener) {