db/proxy: allocate Directory instance on the stack
This commit is contained in:
@ -360,13 +360,9 @@ Visit(struct mpd_connection *connection, Directory &root,
|
|||||||
{
|
{
|
||||||
const char *path = mpd_directory_get_path(directory);
|
const char *path = mpd_directory_get_path(directory);
|
||||||
|
|
||||||
if (visit_directory) {
|
if (visit_directory &&
|
||||||
Directory *d = Directory::NewGeneric(path, &root);
|
!visit_directory(Directory(path, &root), error))
|
||||||
bool success = visit_directory(*d, error);
|
return false;
|
||||||
d->Free();
|
|
||||||
if (!success)
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (recursive &&
|
if (recursive &&
|
||||||
!Visit(connection, root, path, recursive, filter,
|
!Visit(connection, root, path, recursive, filter,
|
||||||
|
Reference in New Issue
Block a user