X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/e7cad4b7a19ff6aafc2e84a6e9099a1742085958..f822acceeee524d6e37fcbcaec3d795319c58d50:/src/xrc/xmlres.cpp?ds=sidebyside 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; } }