From 25d25a4385bfedd9a26ad89fbd30115e1226dd09 Mon Sep 17 00:00:00 2001 From: Paul Cornett Date: Wed, 30 Oct 2019 08:34:47 -0700 Subject: [PATCH] Fix memory leak in conversion from wxAny to wxVariant Dynamically allocated copies in intermediate wxVariantList need to be deleted --- src/common/variant.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/common/variant.cpp b/src/common/variant.cpp index 0098b9a90e..0362653cc8 100644 --- a/src/common/variant.cpp +++ b/src/common/variant.cpp @@ -1982,6 +1982,7 @@ wxVariantData* wxVariantDataList::VariantDataFactory(const wxAny& any) { wxAnyList src = any.As(); wxVariantList dst; + dst.DeleteContents(true); wxAnyList::compatibility_iterator node = src.GetFirst(); while (node) {