Commit 8a7fbf1d authored by Scott Vokes's avatar Scott Vokes
Browse files

Also update cur->next->previous when unlinking items from list.

This was causing memory corruption errors when running the nonblocking /
multithreaded example code - the error didn't require threads to occur,
running 4 threads with 16 concurrent requests each made the failure case
significantly easier to reproduce.

There doesn't appear to be any value in having a doubly linked list, so
the previous pointers should probably be eliminated in another commit.
parent b43c9506
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -156,6 +156,7 @@ static void KineticAllocator_FreeItem(KineticList* const list, void* item, bool
                if (cur->next != NULL) {
                    LOG3("    Next being reset!");
                    cur->previous->next = cur->next;
                    cur->next->previous = cur->previous;
                }
                else {
                    list->last = cur->previous;