diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2020-06-22 14:47:27 +0200 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2020-06-22 15:49:04 +0200 |
commit | 921ee37ea3b648e210ecaff21074456c09b91882 (patch) | |
tree | 0874fdb3851845a14107a9fe80839e0fd7cfa70a /include | |
parent | 65b5a9848bd01cabbbee8f6e751679a04c1da10f (diff) |
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 <sbergman@redhat.com>
Diffstat (limited to 'include')
-rw-r--r-- | include/o3tl/deleter.hxx | 9 |
1 files changed, 9 insertions, 0 deletions
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 <sal/config.h> + +#include <cstdlib> + #include <com/sun/star/uno/Exception.hpp> #include <sal/log.hxx> @@ -44,6 +48,11 @@ template<typename T> struct default_delete } }; +struct free_delete +{ + void operator()(void* p) { std::free(p); } +}; + template<typename uniqueptr> void reset_preserve_ptr_during(uniqueptr& ptr) { // HACK: for the case where the dtor of the obj held by ptr will trigger |