Commit 83488848 authored by Max Kellermann's avatar Max Kellermann

Directory: initialise in default constructor

parent f5a92d6c
...@@ -51,6 +51,15 @@ Directory::Allocate(const char *path) ...@@ -51,6 +51,15 @@ Directory::Allocate(const char *path)
return directory; return directory;
} }
Directory::Directory()
{
INIT_LIST_HEAD(&children);
INIT_LIST_HEAD(&songs);
INIT_LIST_HEAD(&playlists);
path[0] = 0;
}
Directory::Directory(const char *_path) Directory::Directory(const char *_path)
{ {
INIT_LIST_HEAD(&children); INIT_LIST_HEAD(&children);
......
...@@ -100,7 +100,7 @@ public: ...@@ -100,7 +100,7 @@ public:
/** /**
* Default constructor, needed for #detached_root. * Default constructor, needed for #detached_root.
*/ */
Directory() = default; Directory();
~Directory(); ~Directory();
/** /**
......
...@@ -38,6 +38,7 @@ extern "C" { ...@@ -38,6 +38,7 @@ extern "C" {
#include <unistd.h> #include <unistd.h>
#include <stdlib.h> #include <stdlib.h>
Directory::Directory() {}
Directory::~Directory() {} Directory::~Directory() {}
static void static void
......
...@@ -7,6 +7,7 @@ extern "C" { ...@@ -7,6 +7,7 @@ extern "C" {
Directory detached_root; Directory detached_root;
Directory::Directory() {}
Directory::~Directory() {} Directory::~Directory() {}
struct song * struct 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