diff --git a/src/corelib/tools/qcache.h b/src/corelib/tools/qcache.h index 7c065a8806..74784af121 100644 --- a/src/corelib/tools/qcache.h +++ b/src/corelib/tools/qcache.h @@ -237,8 +237,8 @@ public: bool insert(const Key &key, T *object, qsizetype cost = 1) { if (cost > mx) { - delete object; remove(key); + delete object; return false; } trim(mx - cost);