From 83a988e2e48b85afe87c48f6a25d596b0c56054c Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Thu, 9 Jan 2014 13:16:32 +0100 Subject: db/proxy: allocate Directory instance on the stack --- src/db/ProxyDatabasePlugin.cxx | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) (limited to 'src') diff --git a/src/db/ProxyDatabasePlugin.cxx b/src/db/ProxyDatabasePlugin.cxx index a9da1717d..20eb196a6 100644 --- a/src/db/ProxyDatabasePlugin.cxx +++ b/src/db/ProxyDatabasePlugin.cxx @@ -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, -- cgit v1.2.3