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;
« Back to merge proposal
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() ; entry.use_ count++ ; rMode:: multi_monitor_ sync)
clean_ onscreen_ buffers( lk);
last_
auto ret = last_entry.buffer;
if (mode == mc::MultiMonito
return ret;