Use transaction when deleting a feed

This commit is contained in:
daniel oeh 2012-12-19 15:53:40 +01:00
parent f6c31804ec
commit 3c729e8a45
1 changed files with 3 additions and 0 deletions

View File

@ -481,6 +481,7 @@ public class PodDBAdapter {
/** Remove a feed with all its FeedItems and Media entries. */
public void removeFeed(Feed feed) {
db.beginTransaction();
if (feed.getImage() != null) {
removeFeedImage(feed.getImage());
}
@ -489,6 +490,8 @@ public class PodDBAdapter {
}
db.delete(TABLE_NAME_FEEDS, KEY_ID + "=?",
new String[] { String.valueOf(feed.getId()) });
db.setTransactionSuccessful();
db.endTransaction();
}
public void removeDownloadStatus(DownloadStatus remove) {