From 5ebe23e4bba4062161f684931070f59329826d5b Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Wed, 24 Feb 2021 20:38:27 +0100 Subject: [PATCH] db/upnp/Discovery: use class IntrusiveList --- src/lib/upnp/Discovery.cxx | 4 ++-- src/lib/upnp/Discovery.hxx | 11 ++++------- 2 files changed, 6 insertions(+), 9 deletions(-) diff --git a/src/lib/upnp/Discovery.cxx b/src/lib/upnp/Discovery.cxx index db90e5687..e7c2c8569 100644 --- a/src/lib/upnp/Discovery.cxx +++ b/src/lib/upnp/Discovery.cxx @@ -49,8 +49,8 @@ void UPnPDeviceDirectory::Downloader::Destroy() noexcept { const std::lock_guard protect(parent.mutex); - parent.downloaders.erase_and_dispose(parent.downloaders.iterator_to(*this), - DeleteDisposer()); + unlink(); + delete this; } void diff --git a/src/lib/upnp/Discovery.hxx b/src/lib/upnp/Discovery.hxx index 849c5d948..979a6fde6 100644 --- a/src/lib/upnp/Discovery.hxx +++ b/src/lib/upnp/Discovery.hxx @@ -28,8 +28,7 @@ #include "lib/curl/Request.hxx" #include "thread/Mutex.hxx" #include "event/DeferEvent.hxx" - -#include +#include "util/IntrusiveList.hxx" #include #include @@ -80,9 +79,8 @@ class UPnPDeviceDirectory final : UpnpCallback { }; class Downloader final - : public boost::intrusive::list_base_hook>, - CurlResponseHandler { - + : public IntrusiveListHook, CurlResponseHandler + { DeferEvent defer_start_event; UPnPDeviceDirectory &parent; @@ -132,8 +130,7 @@ class UPnPDeviceDirectory final : UpnpCallback { /** * Protected by #mutex. */ - boost::intrusive::list> downloaders; + IntrusiveList downloaders; /** * Protected by #mutex.