diff options
author | Max Kellermann <max@duempel.org> | 2014-01-16 09:03:41 +0100 |
---|---|---|
committer | Max Kellermann <max@duempel.org> | 2014-01-16 09:08:04 +0100 |
commit | 1a09003a6e8fc5ae3b1e4b01ae8432b0ed3ca7bd (patch) | |
tree | 66e531cf6e92bea80619c669ff8412efd1d0b5f2 /src/db/UpnpDatabasePlugin.cxx | |
parent | a8277148230bf02c89656e3839b72d77e8d91cf0 (diff) | |
download | mpd-1a09003a6e8fc5ae3b1e4b01ae8432b0ed3ca7bd.tar.gz mpd-1a09003a6e8fc5ae3b1e4b01ae8432b0ed3ca7bd.tar.xz mpd-1a09003a6e8fc5ae3b1e4b01ae8432b0ed3ca7bd.zip |
db/upnp: move the UPnPDeviceDirectory instance to class UpnpDatabase
Delete the object when closing the database.
Diffstat (limited to 'src/db/UpnpDatabasePlugin.cxx')
-rw-r--r-- | src/db/UpnpDatabasePlugin.cxx | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/src/db/UpnpDatabasePlugin.cxx b/src/db/UpnpDatabasePlugin.cxx index 5381b30a9..3c2ca72ff 100644 --- a/src/db/UpnpDatabasePlugin.cxx +++ b/src/db/UpnpDatabasePlugin.cxx @@ -163,9 +163,10 @@ UpnpDatabase::Open(Error &error) if (!m_lib) return false; - m_superdir = UPnPDeviceDirectory::getTheDir(); - if (!m_superdir || !m_superdir->ok()) { - error.Set(upnp_domain, "Discovery services startup failed"); + m_superdir = new UPnPDeviceDirectory(); + if (!m_superdir->ok()) { + error.Set(m_superdir->GetError()); + delete m_superdir; return false; } @@ -180,7 +181,8 @@ void UpnpDatabase::Close() { delete m_root; - // TBD decide what we do with the lib and superdir objects + delete m_superdir; + // TBD decide what we do with the lib object } void |