bparmentier / OpenBikeSharing

Shared bikes availability in your city
https://openbikesharing.org
Other
67 stars 56 forks source link

Problems about JSONDownloadTask #49

Open pangeneral opened 5 years ago

pangeneral commented 5 years ago

The inner class JSONDownloadTask defined in

  1. be.brunoparmentier.openbikesharing.app.activities.BikeNetworksListActivity
  2. be.brunoparmentier.openbikesharing.app.activities.StationsListActivity holds strong reference to the Activity which can lead to memory leak. I think we should change JSONDownloadTask to an static class or outter class.

Besides, the instance of JSONDownloadTask is not cancelled, which can lead to result loss. I think the instance of JSONDownloadTask should be cancelled before the Activity is destroyed.