{"action":"created","issue":{"url":"https://api.github.com/repos/mapsforge/mapsforge/issues/584","labels_url":"https://api.github.com/repos/mapsforge/mapsforge/issues/584/labels{/name}","comments_url":"https://api.github.com/repos/mapsforge/mapsforge/issues/584/comments","events_url":"https://api.github.com/repos/mapsforge/mapsforge/issues/584/events","html_url":"https://github.com/mapsforge/mapsforge/issues/584","id":59355405,"number":584,"title":"NPE when rotating device several times within short time","user":{"login":"wish7code","id":8270020,"avatar_url":"https://avatars.githubusercontent.com/u/8270020?v=3","gravatar_id":"","url":"https://api.github.com/users/wish7code","html_url":"https://github.com/wish7code","followers_url":"https://api.github.com/users/wish7code/followers","following_url":"https://api.github.com/users/wish7code/following{/other_user}","gists_url":"https://api.github.com/users/wish7code/gists{/gist_id}","starred_url":"https://api.github.com/users/wish7code/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wish7code/subscriptions","organizations_url":"https://api.github.com/users/wish7code/orgs","repos_url":"https://api.github.com/users/wish7code/repos","events_url":"https://api.github.com/users/wish7code/events{/privacy}","received_events_url":"https://api.github.com/users/wish7code/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-02-28T19:53:02Z","updated_at":"2015-02-28T19:56:33Z","closed_at":null,"body":"One of our users reported a strange bug: when rotating the device several times in a very short times, mapsforge crashes with a null pointer exception. (for reference https://code.google.com/p/openbmap/issues/detail?id=72)\r\n\r\nVersion is mapsforge-0.5.0.\r\nI can reproduce the NPE on my Nexus 4 device (although I need to shake for several seconds and it doesn't happen in every case)\r\n\r\nRelevant log cat from my Nexus 4:\r\n02-28 20:43:26.710 E/AndroidRuntime(15442): Caused by: java.lang.NullPointerException\r\n02-28 20:43:26.710 E/AndroidRuntime(15442): \tat org.mapsforge.map.layer.cache.FileSystemTileCache.deleteDirectory(FileSystemTileCache.java:99)\r\n02-28 20:43:26.710 E/AndroidRuntime(15442): \tat org.mapsforge.map.layer.cache.FileSystemTileCache.destroy(FileSystemTileCache.java:198)\r\n02-28 20:43:26.710 E/AndroidRuntime(15442): \tat org.mapsforge.map.layer.cache.TwoLevelTileCache.destroy(TwoLevelTileCache.java:49)\r\n02-28 20:43:26.710 E/AndroidRuntime(15442): \tat org.openbmap.activities.MapViewActivity.releaseMap(MapViewActivity.java:1006)\r\n02-28 20:43:26.710 E/AndroidRuntime(15442): \tat org.openbmap.activities.MapViewActivity.onDestroy(MapViewActivity.java:380)\r\n02-28 20:43:26.710 E/AndroidRuntime(15442): \tat android.support.v4.app.Fragment.performDestroy(Fragment.java:2006)\r\n02-28 20:43:26.710 E/AndroidRuntime(15442): \tat android.support.v4.app.FragmentManagerImpl.moveToState(FragmentManager.java:1076)\r\n02-28 20:43:26.710 E/AndroidRuntime(15442): \tat android.support.v4.app.FragmentManagerImpl.moveToState(FragmentManager.java:1126)\r\n02-28 20:43:26.710 E/AndroidRuntime(15442): \tat android.support.v4.app.FragmentManagerImpl.moveToState(FragmentManager.java:1108)\r\n02-28 20:43:26.710 E/AndroidRuntime(15442): \tat android.support.v4.app.FragmentManagerImpl.dispatchDestroy(FragmentManager.java:1954)\r\n02-28 20:43:26.710 E/AndroidRuntime(15442): \tat android.support.v4.app.FragmentActivity.onDestroy(FragmentActivity.java:313)\r\n02-28 20:43:26.710 E/AndroidRuntime(15442): \tat com.actionbarsherlock.app.SherlockFragmentActivity.onDestroy(SherlockFragmentActivity.java:87)\r\n02-28 20:43:26.710 E/AndroidRuntime(15442): \tat org.openbmap.activities.HostActivity.onDestroy(HostActivity.java:306)\r\n02-28 20:43:26.710 E/AndroidRuntime(15442): \tat android.app.Activity.performDestroy(Activity.java:5491)\r\n02-28 20:43:26.710 E/AndroidRuntime(15442): \tat android.app.Instrumentation.callActivityOnDestroy(Instrumentation.java:1117)\r\n02-28 20:43:26.710 E/AndroidRuntime(15442): \tat android.app.ActivityThread.performDestroyActivity(ActivityThread.java:3491)"},"comment":{"url":"https://api.github.com/repos/mapsforge/mapsforge/issues/comments/76542887","html_url":"https://github.com/mapsforge/mapsforge/issues/584#issuecomment-76542887","issue_url":"https://api.github.com/repos/mapsforge/mapsforge/issues/584","id":76542887,"user":{"login":"devemux86","id":3484020,"avatar_url":"https://avatars.githubusercontent.com/u/3484020?v=3","gravatar_id":"","url":"https://api.github.com/users/devemux86","html_url":"https://github.com/devemux86","followers_url":"https://api.github.com/users/devemux86/followers","following_url":"https://api.github.com/users/devemux86/following{/other_user}","gists_url":"https://api.github.com/users/devemux86/gists{/gist_id}","starred_url":"https://api.github.com/users/devemux86/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/devemux86/subscriptions","organizations_url":"https://api.github.com/users/devemux86/orgs","repos_url":"https://api.github.com/users/devemux86/repos","events_url":"https://api.github.com/users/devemux86/events{/privacy}","received_events_url":"https://api.github.com/users/devemux86/received_events","type":"User","site_admin":false},"created_at":"2015-02-28T19:56:33Z","updated_at":"2015-02-28T19:56:33Z","body":"Thanks for the report. Are you using threaded cache?\r\n\r\nBy the way you don't need to restart the activity at each device orientation change (if you don't want)."}}