From 8d2370635408b9acd392843de96179383a95a4bf Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Mon, 19 Oct 2015 15:57:00 +0200 Subject: util/DeleteDisposer: new utility class --- src/lib/nfs/Manager.cxx | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) (limited to 'src/lib/nfs') diff --git a/src/lib/nfs/Manager.cxx b/src/lib/nfs/Manager.cxx index 8b0a9ba9a..1cbf18ff1 100644 --- a/src/lib/nfs/Manager.cxx +++ b/src/lib/nfs/Manager.cxx @@ -21,6 +21,7 @@ #include "Manager.hxx" #include "event/Loop.hxx" #include "Log.hxx" +#include "util/DeleteDisposer.hxx" #include @@ -65,9 +66,7 @@ NfsManager::~NfsManager() CollectGarbage(); - connections.clear_and_dispose([](ManagedConnection *c){ - delete c; - }); + connections.clear_and_dispose(DeleteDisposer()); } NfsConnection & @@ -95,9 +94,7 @@ NfsManager::CollectGarbage() { assert(GetEventLoop().IsInside()); - garbage.clear_and_dispose([](ManagedConnection *c){ - delete c; - }); + garbage.clear_and_dispose(DeleteDisposer()); } void -- cgit v1.2.3