Issue information

Issue ID
#999
Status
Fixed
Severity
Critical
Started
Hercules Elf Bot
Feb 19, 2008 10:48
Last Post
Hercules Elf Bot
Feb 19, 2008 10:48
Confirmation
N/A

Hercules Elf Bot - Feb 19, 2008 10:48

Originally posted by [b]theultramage[/b]
http://www.eathena.ws/board/index.php?autocom=bugtracker&showbug=999

I was investigating the crash mentioned here, and coding some hack around it, and I made a mistake of not deleting an iterator of pc_db that I had created. This caused the db to lock up and not discard entries that got deleted afterwards.

This wouldn't be an issue, if db key/value retrieval code would skip entries marked as 'deleted'. But it doesn't, which I find very surprising - yet flaviojs didn't seem to mind much.

Here's my reasoning: When iterating over all objects in the db, these deleted entries are skipped. But when retrieving a certain key/value pair, they aren't. But what is the point of providing the data pointer for a certain key, if you are 100% sure the data pointed to has already been destroyed and deallocated?

(side note, why doesn't db set the 'data' value to 0 or -1 or w/e after it deletes the data, but instead keeps it alive?)