diff --git a/Jupiter/Rehash.cpp b/Jupiter/Rehash.cpp index 88c9393..fc5af2f 100644 --- a/Jupiter/Rehash.cpp +++ b/Jupiter/Rehash.cpp @@ -59,14 +59,21 @@ unsigned int Jupiter::rehash() if (rehashables.size() == 0) return 0; unsigned int total = 0; int r; - for (Jupiter::DLList::Node *n = rehashables.getNode(0); n != nullptr; n = n->next) + Jupiter::DLList::Node *n = rehashables.getNode(0); + while (n != nullptr) { r = n->data->OnRehash(); if (r != 0) { total++; - if (r < 0) delete n->data; + if (r < 0) + { + n = n->next; + delete rehashables.remove(n->previous); + continue; + } } + n = n->next; } return total; } diff --git a/Release/Jupiter.lib b/Release/Jupiter.lib index ddc126e..7b72af9 100644 Binary files a/Release/Jupiter.lib and b/Release/Jupiter.lib differ