mirror of https://github.com/mgba-emu/mgba.git
Core: Fix crash modifying hash table entry (fixes #1673)
This commit is contained in:
parent
5f3dc723f6
commit
dbd3aba527
1
CHANGES
1
CHANGES
|
@ -1,6 +1,7 @@
|
||||||
0.8.2: (Future)
|
0.8.2: (Future)
|
||||||
Other fixes:
|
Other fixes:
|
||||||
- Core: Fix ELF loading regression (fixes mgba.io/i/1669)
|
- Core: Fix ELF loading regression (fixes mgba.io/i/1669)
|
||||||
|
- Core: Fix crash modifying hash table entry (fixes mgba.io/i/1673)
|
||||||
|
|
||||||
0.8.1: (2020-02-16)
|
0.8.1: (2020-02-16)
|
||||||
Emulation fixes:
|
Emulation fixes:
|
||||||
|
|
|
@ -187,7 +187,9 @@ void HashTableInsert(struct Table* table, const char* key, void* value) {
|
||||||
struct TableList* list;
|
struct TableList* list;
|
||||||
TABLE_LOOKUP_START(HASH_TABLE_COMPARATOR, list, hash) {
|
TABLE_LOOKUP_START(HASH_TABLE_COMPARATOR, list, hash) {
|
||||||
if (value != lookupResult->value) {
|
if (value != lookupResult->value) {
|
||||||
table->deinitializer(lookupResult->value);
|
if (table->deinitializer) {
|
||||||
|
table->deinitializer(lookupResult->value);
|
||||||
|
}
|
||||||
lookupResult->value = value;
|
lookupResult->value = value;
|
||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
|
|
Loading…
Reference in New Issue