OSDN Git Service

Fix cursor memory leak
authorCatherine Liu <wlcl05@motorola.com>
Mon, 11 Jun 2012 21:38:17 +0000 (16:38 -0500)
committerCatherine Liu <wlcl05@motorola.com>
Mon, 9 Jul 2012 21:34:58 +0000 (16:34 -0500)
commit3f824c0e72ad8cde2dc9b0f4d4d7b621b5535e62
treedf1b2e630adfd47bc08551b03649be55a5d894f3
parent7d77977ffab9b5d7d154894afda2c70def1222f5
Fix cursor memory leak

In current code, if an application opens a cursor to access a
provider, and doesn't close that cursor, later, when this cursor
is garbage collected, it won't get closed. This will cause a memory
leak in the provider. The leaked memory can only be reclaimed when
the application with the leaked cursor was dead.

The solution is, close the cursor when it's garbage collected.

Change-Id: I786915c46d4672b6b1b37414b3bc1ff8cea2e00b
core/java/android/database/AbstractCursor.java