From 5d5ba00f7d057072ebc607b0e693b89540e81401 Mon Sep 17 00:00:00 2001 From: dgelessus Date: Sun, 25 Jun 2023 16:49:58 +0200 Subject: [PATCH] Also guard against accessing plRegistryKeyList currently being deleted Co-authored-by: Adam Johnson (ported from H-uru/Plasma@725eeaa28820423f8f36e3476d0f5c6da30921c2) --- Sources/Plasma/PubUtilLib/plResMgr/plRegistryKeyList.cpp | 2 +- Sources/Plasma/PubUtilLib/plResMgr/plRegistryNode.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Sources/Plasma/PubUtilLib/plResMgr/plRegistryKeyList.cpp b/Sources/Plasma/PubUtilLib/plResMgr/plRegistryKeyList.cpp index cc6d35a0..6f292d59 100644 --- a/Sources/Plasma/PubUtilLib/plResMgr/plRegistryKeyList.cpp +++ b/Sources/Plasma/PubUtilLib/plResMgr/plRegistryKeyList.cpp @@ -60,8 +60,8 @@ plRegistryKeyList::~plRegistryKeyList() { plKeyImp* keyImp = fStaticKeys[i]; if (keyImp && !keyImp->ObjectIsLoaded()) { - delete keyImp; keyImp = nullptr; + delete keyImp; } } } diff --git a/Sources/Plasma/PubUtilLib/plResMgr/plRegistryNode.cpp b/Sources/Plasma/PubUtilLib/plResMgr/plRegistryNode.cpp index 847645c5..c0eacdcb 100644 --- a/Sources/Plasma/PubUtilLib/plResMgr/plRegistryNode.cpp +++ b/Sources/Plasma/PubUtilLib/plResMgr/plRegistryNode.cpp @@ -203,8 +203,8 @@ void plRegistryPageNode::UnloadKeys() for (; it != fKeyLists.end(); it++) { plRegistryKeyList* keyList = it->second; - delete keyList; it->second = nullptr; + delete keyList; } fKeyLists.clear();