From 4697f3cdada9138ea9ead70e913c1531b5b9bb32 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Mon, 17 Apr 2023 20:06:42 +0100 Subject: [PATCH] Use std::unordered_map<> in wxFileSystem Use the standard containers directly instead of using wx synonyms. --- include/wx/filesys.h | 5 +++-- src/common/filesys.cpp | 3 ++- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/include/wx/filesys.h b/include/wx/filesys.h index cf5a99d45a..ea46f69139 100644 --- a/include/wx/filesys.h +++ b/include/wx/filesys.h @@ -16,7 +16,8 @@ #include "wx/stream.h" #include "wx/datetime.h" #include "wx/filename.h" -#include "wx/hashmap.h" + +#include class WXDLLIMPEXP_FWD_BASE wxFSFile; class WXDLLIMPEXP_FWD_BASE wxFileSystemHandler; @@ -165,7 +166,7 @@ enum wxFileSystemOpenFlags wxFS_SEEKABLE = 4 // Returned stream will be seekable }; -WX_DECLARE_VOIDPTR_HASH_MAP_WITH_DECL(wxFileSystemHandler*, wxFSHandlerHash, class WXDLLIMPEXP_BASE); +using wxFSHandlerHash = std::unordered_map; class WXDLLIMPEXP_BASE wxFileSystem : public wxObject { diff --git a/src/common/filesys.cpp b/src/common/filesys.cpp index c0a322de62..aabb9255a1 100644 --- a/src/common/filesys.cpp +++ b/src/common/filesys.cpp @@ -334,7 +334,8 @@ wxList wxFileSystem::m_Handlers; wxFileSystem::~wxFileSystem() { - WX_CLEAR_HASH_MAP(wxFSHandlerHash, m_LocalHandlers) + for ( const auto& kv : m_LocalHandlers ) + delete kv.second; }