db/proxy: allocate Directory instance on the stack

This commit is contained in:
Max Kellermann 2014-01-09 13:16:32 +01:00
parent 91efe1cb5a
commit 83a988e2e4
1 changed files with 3 additions and 7 deletions

View File

@ -360,13 +360,9 @@ Visit(struct mpd_connection *connection, Directory &root,
{
const char *path = mpd_directory_get_path(directory);
if (visit_directory) {
Directory *d = Directory::NewGeneric(path, &root);
bool success = visit_directory(*d, error);
d->Free();
if (!success)
return false;
}
if (visit_directory &&
!visit_directory(Directory(path, &root), error))
return false;
if (recursive &&
!Visit(connection, root, path, recursive, filter,