diff --git a/src/dict.cpp b/src/dict.cpp index 7c2a5cd13..fe495dc7b 100644 --- a/src/dict.cpp +++ b/src/dict.cpp @@ -186,11 +186,15 @@ int dictMerge(dict *dst, dict *src) if (dictSize(dst) == 0) { std::swap(*dst, *src); + std::swap(dst->iterators, src->iterators); return DICT_OK; } if (dictSize(src) > dictSize(dst)) + { std::swap(*dst, *src); + std::swap(dst->iterators, src->iterators); + } if (!dictIsRehashing(dst) && !dictIsRehashing(src)) {