You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
My own code crashed in the method _removeLru with a null pointer access when calling _tail.next.
After debugging I discovered that the cause seems to be in the remove() method.
There exists a check whether the removed entry is equal to _head, or it is equal to _tail.
If it happens to be the last item that gets removed, that is not handled correctly. Right now it branches into the entry == _head, resets _head, but leaves _tail in its old value, which is wrong.
If my understanding is correct, in that case both _tail and _head need to be reset to null. Adding a test for entry == _head && entry == _tail to reset the _tail and _head to null appears to fix the problem:
My own code crashed in the method
_removeLru
with a null pointer access when calling_tail.next
.After debugging I discovered that the cause seems to be in the
remove()
method.There exists a check whether the removed
entry
is equal to_head
, or it is equal to_tail
.If it happens to be the last item that gets removed, that is not handled correctly. Right now it branches into the
entry == _head
, resets _head, but leaves _tail in its old value, which is wrong.If my understanding is correct, in that case both
_tail
and_head
need to be reset to null. Adding a test forentry == _head && entry == _tail
to reset the_tail
and_head
tonull
appears to fix the problem:The text was updated successfully, but these errors were encountered: