From 19bc8856c4b5444f80375919c2aed00c7de53a28 Mon Sep 17 00:00:00 2001 From: Noel Grandin Date: Mon, 21 Oct 2024 14:36:51 +0200 Subject: move vcl::DeleteOnDeinit to tools so we can fix a shutdown use-after-free in sot. Change-Id: I32f83bd94627d72d7bee7ea2ebd6ab77a7f78435 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/175335 Tested-by: Jenkins Reviewed-by: Noel Grandin --- sot/source/base/exchange.cxx | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'sot/source') diff --git a/sot/source/base/exchange.cxx b/sot/source/base/exchange.cxx index 061a794af57c..c7048b166c6f 100644 --- a/sot/source/base/exchange.cxx +++ b/sot/source/base/exchange.cxx @@ -21,6 +21,7 @@ #include #include +#include #include #include #include @@ -210,9 +211,9 @@ const DataFlavorRepresentation* FormatArray_Impl() static tDataFlavorList& InitFormats_Impl() { - static tDataFlavorList gImplData; + static tools::DeleteOnDeinit gImplData; - return gImplData; + return *gImplData.get(); } /************************************************************************* -- cgit