Merge pull request #4869 from owncloud/fix/delete_unused_resources