---
 src/db/update/Walk.cxx |    7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/src/db/update/Walk.cxx b/src/db/update/Walk.cxx
index e6bfdcf..118f86e 100644
--- a/src/db/update/Walk.cxx
+++ b/src/db/update/Walk.cxx
@@ -46,6 +46,7 @@
 #include <string.h>
 #include <stdlib.h>
 #include <errno.h>
+#include <memory>
  UpdateWalk::UpdateWalk(EventLoop &_loop, DatabaseListener &_listener)
        :storage(mapper_get_music_directory_utf8(),
@@ -319,9 +320,9 @@ UpdateWalk::UpdateDirectory(Directory &directory, const FileInfo &info)
        directory_set_stat(directory, info);
        Error error;
-       LocalDirectoryReader *const reader =
-               storage.OpenDirectory(directory.GetPath(), error);
-       if (reader == nullptr) {
+       const std::auto_ptr<LocalDirectoryReader> reader(
+               storage.OpenDirectory(directory.GetPath(), error));
+       if (reader.get() == nullptr) {
                LogError(error);
                return false;
        }

---
 src/db/update/Walk.cxx |    7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/src/db/update/Walk.cxx b/src/db/update/Walk.cxx
index e6bfdcf..118f86e 100644
--- a/src/db/update/Walk.cxx
+++ b/src/db/update/Walk.cxx
@@ -46,6 +46,7 @@
 #include <string.h>
 #include <stdlib.h>
 #include <errno.h>
+#include <memory>
 
 UpdateWalk::UpdateWalk(EventLoop &_loop, DatabaseListener &_listener)
    :storage(mapper_get_music_directory_utf8(),
@@ -319,9 +320,9 @@ UpdateWalk::UpdateDirectory(Directory &directory, const FileInfo &info)
    directory_set_stat(directory, info);
 
    Error error;
-   LocalDirectoryReader *const reader =
-       storage.OpenDirectory(directory.GetPath(), error);
-   if (reader == nullptr) {
+   const std::auto_ptr<LocalDirectoryReader> reader(
+       storage.OpenDirectory(directory.GetPath(), error));
+   if (reader.get() == nullptr) {
        LogError(error);
        return false;
    }

_______________________________________________
mpd-devel mailing list
[email protected]
http://mailman.blarg.de/listinfo/mpd-devel

Reply via email to