Commit 0c34555b authored by Max Kellermann's avatar Max Kellermann

Directory: remove method Free()

parent 83a988e2
...@@ -53,7 +53,7 @@ Directory::~Directory() ...@@ -53,7 +53,7 @@ Directory::~Directory()
Directory *child, *n; Directory *child, *n;
directory_for_each_child_safe(child, n, *this) directory_for_each_child_safe(child, n, *this)
child->Free(); delete child;
} }
void void
...@@ -63,7 +63,7 @@ Directory::Delete() ...@@ -63,7 +63,7 @@ Directory::Delete()
assert(parent != nullptr); assert(parent != nullptr);
list_del(&siblings); list_del(&siblings);
Free(); delete this;
} }
const char * const char *
......
...@@ -100,14 +100,6 @@ public: ...@@ -100,14 +100,6 @@ public:
} }
/** /**
* 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 * Remove this #Directory object from its parent and free it. This
* must not be called with the root Directory. * must not be called with the root Directory.
* *
......
...@@ -251,7 +251,7 @@ ProxyDatabase::Open(Error &error) ...@@ -251,7 +251,7 @@ ProxyDatabase::Open(Error &error)
void void
ProxyDatabase::Close() ProxyDatabase::Close()
{ {
root->Free(); delete root;
if (connection != nullptr) if (connection != nullptr)
mpd_connection_free(connection); mpd_connection_free(connection);
......
...@@ -168,7 +168,7 @@ SimpleDatabase::Open(Error &error) ...@@ -168,7 +168,7 @@ SimpleDatabase::Open(Error &error)
#endif #endif
if (!Load(error)) { if (!Load(error)) {
root->Free(); delete root;
LogError(error); LogError(error);
error.Clear(); error.Clear();
...@@ -188,7 +188,7 @@ SimpleDatabase::Close() ...@@ -188,7 +188,7 @@ SimpleDatabase::Close()
assert(root != nullptr); assert(root != nullptr);
assert(borrowed_song_count == 0); assert(borrowed_song_count == 0);
root->Free(); delete root;
} }
Song * Song *
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment