From 921ee37ea3b648e210ecaff21074456c09b91882 Mon Sep 17 00:00:00 2001 From: Stephan Bergmann Date: Mon, 22 Jun 2020 14:47:27 +0200 Subject: Consolidate unique_ptr deleters calling free Change-Id: I57a977dbb521270a466d464df8c31c364179ec20 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/96854 Tested-by: Jenkins Reviewed-by: Stephan Bergmann --- include/o3tl/deleter.hxx | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'include/o3tl') diff --git a/include/o3tl/deleter.hxx b/include/o3tl/deleter.hxx index 4e90ca5a61f6..72d13d086de1 100644 --- a/include/o3tl/deleter.hxx +++ b/include/o3tl/deleter.hxx @@ -10,6 +10,10 @@ #ifndef INCLUDED_O3TL_DELETER_HXX #define INCLUDED_O3TL_DELETER_HXX +#include + +#include + #include #include @@ -44,6 +48,11 @@ template struct default_delete } }; +struct free_delete +{ + void operator()(void* p) { std::free(p); } +}; + template void reset_preserve_ptr_during(uniqueptr& ptr) { // HACK: for the case where the dtor of the obj held by ptr will trigger -- cgit v1.2.3