Reputation: 3497
I was looking at code for a sample Android application. Within the code, the application creates an HttpClient, but I never see anywhere where the connection is closed. So I was wondering does this code create a memory leak? If not, can you explain why?
The link to the sample code is at:
http://developer.android.com/resources/samples/SampleSyncAdapter/src/com/example/android/samplesync/client/NetworkUtilities.html
Upvotes: 1
Views: 1388
Reputation: 234847
HttpClient relies on a ClientConnectionManager to handle opening and closing connections. It (HttpClient) is a utility class that is supposed to allow you to forget about lots of details like closing connections.
"That's not a bug. It's a feature!"
Upvotes: 3