Closed GoogleCodeExporter closed 8 years ago
Suggested approach to fix:
Add void close(); method to IArchiveFile which means each class implementing
interface, of course, needs to implement, including MBTilesFileArchive. It's
probably not a bad thing that all IArchiveFile classes do some file closing!
In MBTilesFileArchive it's nothing more complicated than:
public void close()
{
mDatabase.close();
}
Then the close() needs to get called when the MapView is going away, which
means overriding onDetach() and calling mTileProvider.detach() and adding
mArchiveFiles.get(0).close(); to the loop in MapTileProvider.detach() that
removes all the archive file references from the array.
Hope this helps - it seems to work for me!
Original comment by mgwjenk...@gmail.com
on 28 Mar 2012 at 12:58
This problem might only show up when modifying the opening of the SQLite
database to READ+WRITE which is necessary on some real-world (not emulator)
devices - see other issue - 318.
Original comment by mgwjenk...@gmail.com
on 28 Mar 2012 at 1:18
See also issue 318.
Original comment by neilboyd
on 28 Mar 2012 at 3:30
a workaround would be to expose the MBTilesFileArchive constructor so one can
provide his own database, read-only or not.
Original comment by schizosfera@gmail.com
on 25 May 2012 at 8:12
I've created a patch with the changes mgwjenkins proposes. They work really
well and I didn't observe any problems with it in my app. With this patch
applied, I just call the MapView.onDetach() method in my fragment's
onDestroyView() method.
Because "Issue attachment storage quota exceeded", I copied the patch to
pastebin: http://pastebin.com/BdWWN5hX
Original comment by philipp....@gmail.com
on 2 Mar 2014 at 12:59
I've committed the patch in revision 1449.
Original comment by neilboyd
on 3 Mar 2014 at 7:12
It's been in for a while so I guess it must be okay
Original comment by neilboyd
on 27 Aug 2014 at 5:55
Original issue reported on code.google.com by
mgwjenk...@gmail.com
on 28 Mar 2012 at 12:01