Mir

Code review comment for lp:~kuchtam/mir/Bug_1664760

Revision history for this message
Daniel van Vugt (vanvugt) wrote :

Great fix, thanks!

I think it would be more clear and safer for future maintenance though to save the return value before the iterator gets invalidated:

    auto& last_entry = onscreen_buffers.front();
    last_entry.use_count++;
    auto ret = last_entry.buffer;
    if (mode == mc::MultiMonitorMode::multi_monitor_sync)
        clean_onscreen_buffers(lk);
    return ret;

review: Needs Fixing

« Back to merge proposal