Skip to content

Commit

Permalink
Merge pull request #405 from peppy/fix-db-deletion
Browse files Browse the repository at this point in the history
Actually delete all related database entries, not just the set.
  • Loading branch information
peppy authored Feb 27, 2017
2 parents 6d8b4cd + f96144f commit 2e84188
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions osu.Game/Database/BeatmapDatabase.cs
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,18 @@ private void deletePending()
try
{
storage.Delete(b.Path);

GetChildren(b, true);

foreach (var i in b.Beatmaps)
{
if (i.Metadata != null) connection.Delete(i.Metadata);
if (i.BaseDifficulty != null) connection.Delete(i.BaseDifficulty);

connection.Delete(i);
}

if (b.Metadata != null) connection.Delete(b.Metadata);
connection.Delete(b);
}
catch (Exception e)
Expand Down

0 comments on commit 2e84188

Please sign in to comment.