fixed leaked LocalDirectoryReader *const reader in UpdateWalk::UpdateDirectory
This commit is contained in:
parent
c8f0c7e9ed
commit
0f1f509be7
@ -47,6 +47,7 @@
|
|||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
|
#include <memory>
|
||||||
|
|
||||||
UpdateWalk::UpdateWalk(EventLoop &_loop, DatabaseListener &_listener,
|
UpdateWalk::UpdateWalk(EventLoop &_loop, DatabaseListener &_listener,
|
||||||
Storage &_storage)
|
Storage &_storage)
|
||||||
@ -320,9 +321,8 @@ UpdateWalk::UpdateDirectory(Directory &directory, const FileInfo &info)
|
|||||||
directory_set_stat(directory, info);
|
directory_set_stat(directory, info);
|
||||||
|
|
||||||
Error error;
|
Error error;
|
||||||
StorageDirectoryReader *const reader =
|
const std::auto_ptr<StorageDirectoryReader> reader(storage.OpenDirectory(directory.GetPath(), error));
|
||||||
storage.OpenDirectory(directory.GetPath(), error);
|
if (reader.get() == nullptr) {
|
||||||
if (reader == nullptr) {
|
|
||||||
LogError(error);
|
LogError(error);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user