From adf1edd9246dfe4bd1a5023a8179b8d54ee2e66f Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Mon, 8 Nov 2010 13:50:46 +0000 Subject: [PATCH] Fix crash in XRC ID range support code. Really fix removing the record from the linked list. This code was modified by r66064 but was still wrong because the wrong pointer was updated. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@66069 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/xrc/xmlres.cpp | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/src/xrc/xmlres.cpp b/src/xrc/xmlres.cpp index f24b8455c6..eebc913691 100644 --- a/src/xrc/xmlres.cpp +++ b/src/xrc/xmlres.cpp @@ -2641,16 +2641,14 @@ void wxIdRangeManager::RemoveXRCIDEntry(const wxString& idstr) if (wxStrcmp(rec->key, str_id) == 0) { // Found the item to be removed so delete its record; but first - // replace it in the table with any rec->next (usually == NULL) - (*p_previousrec) = rec->next; + // remove it from the linked list. + *p_previousrec = rec->next; free(rec->key); delete rec; return; } - else - { - p_previousrec = &rec; - } + + p_previousrec = &rec->next; } } -- 2.47.2