Details
-
Bug
-
Resolution: Fixed
-
P2: Important
-
6.2.13, 6.3.2, 6.4.3, 6.5.8, 6.6.3, 6.7.3, 6.8.1, 6.9.0 Beta1
-
None
-
3
-
9f4325e67 (dev), d2c4f6df2 (6.9), ca216b7be (6.8), 536c11127 (tqtc/lts-6.5), 0c953a6c2 (tqtc/lts-6.2)
-
Foundation Sprint 123, Foundation Sprint 124
Description
When the platform supports std::pmr, the container used by QDuplicateTracker is a pmr::unordered_set with a pmr::monotonic_buffer_resource. The latter's deallocate() call is a no-op, because m_b_r, and therefore QDuplicateTracker, are designed for one-off use, not repeated use. Therefore, clear(), as implemented, will not release the memory allocated in res and, over time, appear to leak memory on every clear().
Unfortunately, there's implementation divergence in m_b_r::release() (MSVC doesn't allow allocate() after release(), it seems, cf. LWG3120) so it won't be straight-forward to fix. Also, we need to make sure that set doesn't reference anything in res anymore, before calling res.release().