{"action":"created","issue":{"url":"https://api.github.com/repos/mrmans0n/smart-location-lib/issues/16","labels_url":"https://api.github.com/repos/mrmans0n/smart-location-lib/issues/16/labels{/name}","comments_url":"https://api.github.com/repos/mrmans0n/smart-location-lib/issues/16/comments","events_url":"https://api.github.com/repos/mrmans0n/smart-location-lib/issues/16/events","html_url":"https://github.com/mrmans0n/smart-location-lib/issues/16","id":44720855,"number":16,"title":"MemoryLeak by broadcastReceiver","user":{"login":"ultraon","id":6382537,"avatar_url":"https://avatars.githubusercontent.com/u/6382537?v=3","gravatar_id":"","url":"https://api.github.com/users/ultraon","html_url":"https://github.com/ultraon","followers_url":"https://api.github.com/users/ultraon/followers","following_url":"https://api.github.com/users/ultraon/following{/other_user}","gists_url":"https://api.github.com/users/ultraon/gists{/gist_id}","starred_url":"https://api.github.com/users/ultraon/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ultraon/subscriptions","organizations_url":"https://api.github.com/users/ultraon/orgs","repos_url":"https://api.github.com/users/ultraon/repos","events_url":"https://api.github.com/users/ultraon/events{/privacy}","received_events_url":"https://api.github.com/users/ultraon/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/mrmans0n/smart-location-lib/labels/bug","name":"bug","color":"fc2929"}],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2014-10-02T18:30:46Z","updated_at":"2015-01-10T15:00:42Z","closed_at":"2015-01-10T15:00:42Z","body":"Hi, i tried your library, it is very convenient.\r\nBut in Strict mode, i got this message in LogCat:\r\n```java\r\nandroid.app.IntentReceiverLeaked: Service io.nlopez.smartlocation.SmartLocationService has leaked IntentReceiver io.nlopez.smartlocation.SmartLocationService$2@41e3bef8 that was originally registered here. Are you missing a call to unregisterReceiver()?\r\n```\r\nI think you should correct your code in SmartLocationService.java:\r\n```java\r\nprivate void continueStartLocation() {\r\n        if (smartLocationOptions.isDebugging()) {\r\n            Log.v(TAG, \"fused - continueStartLocation\");\r\n        }\r\n        if (locationClient.isConnected()) {\r\n            locationClient.requestLocationUpdates(locationRequest, this);\r\n        } else {\r\n            if (smartLocationOptions.isActivityRecognizer()) {\r\n        IntentFilter intentFilterActivityUpdates = new IntentFilter(ActivityRecognitionConstants.ACTIVITY_CHANGED_INTENT);\r\n        registerReceiver(activityUpdatesReceiver, intentFilterActivityUpdates);\r\n\r\n}\r\n}\r\n    }\r\n```\r\nWhat do you think?"},"comment":{"url":"https://api.github.com/repos/mrmans0n/smart-location-lib/issues/comments/69458605","html_url":"https://github.com/mrmans0n/smart-location-lib/issues/16#issuecomment-69458605","issue_url":"https://api.github.com/repos/mrmans0n/smart-location-lib/issues/16","id":69458605,"user":{"login":"mrmans0n","id":534307,"avatar_url":"https://avatars.githubusercontent.com/u/534307?v=3","gravatar_id":"","url":"https://api.github.com/users/mrmans0n","html_url":"https://github.com/mrmans0n","followers_url":"https://api.github.com/users/mrmans0n/followers","following_url":"https://api.github.com/users/mrmans0n/following{/other_user}","gists_url":"https://api.github.com/users/mrmans0n/gists{/gist_id}","starred_url":"https://api.github.com/users/mrmans0n/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mrmans0n/subscriptions","organizations_url":"https://api.github.com/users/mrmans0n/orgs","repos_url":"https://api.github.com/users/mrmans0n/repos","events_url":"https://api.github.com/users/mrmans0n/events{/privacy}","received_events_url":"https://api.github.com/users/mrmans0n/received_events","type":"User","site_admin":false},"created_at":"2015-01-10T15:00:42Z","updated_at":"2015-01-10T15:00:42Z","body":"This should have been fixed in the 3.0.0 release."}}