Directory: remove method Free()
This commit is contained in:
parent
83a988e2e4
commit
0c34555b02
@ -53,7 +53,7 @@ Directory::~Directory()
|
||||
|
||||
Directory *child, *n;
|
||||
directory_for_each_child_safe(child, n, *this)
|
||||
child->Free();
|
||||
delete child;
|
||||
}
|
||||
|
||||
void
|
||||
@ -63,7 +63,7 @@ Directory::Delete()
|
||||
assert(parent != nullptr);
|
||||
|
||||
list_del(&siblings);
|
||||
Free();
|
||||
delete this;
|
||||
}
|
||||
|
||||
const char *
|
||||
|
@ -99,14 +99,6 @@ public:
|
||||
return new Directory("", nullptr);
|
||||
}
|
||||
|
||||
/**
|
||||
* Free this #Directory object (and the whole object tree within it),
|
||||
* assuming it was already removed from the parent.
|
||||
*/
|
||||
void Free() {
|
||||
delete this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Remove this #Directory object from its parent and free it. This
|
||||
* must not be called with the root Directory.
|
||||
|
@ -251,7 +251,7 @@ ProxyDatabase::Open(Error &error)
|
||||
void
|
||||
ProxyDatabase::Close()
|
||||
{
|
||||
root->Free();
|
||||
delete root;
|
||||
|
||||
if (connection != nullptr)
|
||||
mpd_connection_free(connection);
|
||||
|
@ -168,7 +168,7 @@ SimpleDatabase::Open(Error &error)
|
||||
#endif
|
||||
|
||||
if (!Load(error)) {
|
||||
root->Free();
|
||||
delete root;
|
||||
|
||||
LogError(error);
|
||||
error.Clear();
|
||||
@ -188,7 +188,7 @@ SimpleDatabase::Close()
|
||||
assert(root != nullptr);
|
||||
assert(borrowed_song_count == 0);
|
||||
|
||||
root->Free();
|
||||
delete root;
|
||||
}
|
||||
|
||||
Song *
|
||||
|
Loading…
Reference in New Issue
Block a user