Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-132945

QDuplicateTracker::clear() leaks memory

    XMLWordPrintable

Details

    • 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().

      Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            mmutz Marc Mutz
            mmutz Marc Mutz
            Vladimir Minenko Vladimir Minenko
            Alex Blasche Alex Blasche
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: