*fixed a memory leak with wrong iterator usage.

This commit is contained in:
Wang Renxin 2018-11-05 12:09:05 +08:00
parent 3eff55c2aa
commit c394f5ac19
2 changed files with 8 additions and 0 deletions

View File

@ -1,5 +1,6 @@
Nov. 5 2018 Nov. 5 2018
Fixed a crash bug when using an iterator in a conditional expression Fixed a crash bug when using an iterator in a conditional expression
Fixed a memory leak with wrong iterator usage
Jul. 30 2018 Jul. 30 2018
Fixed a crash bug with incomplete structures Fixed a crash bug with incomplete structures

View File

@ -8001,6 +8001,13 @@ static bool_t _remove_dict(_dict_t* coll, mb_value_t* key) {
mb_assert(coll && key); mb_assert(coll && key);
_create_internal_object_from_public_value(key, &okey); _create_internal_object_from_public_value(key, &okey);
if(_try_purge_it(coll->ref.s, key, okey)) {
_destroy_object_capsule_only(okey, 0);
return false;
}
result = _ht_find(coll->dict, okey); result = _ht_find(coll->dict, okey);
if(result && result->data) { if(result && result->data) {
_ht_remove(coll->dict, okey, _ls_cmp_extra_object); _ht_remove(coll->dict, okey, _ls_cmp_extra_object);