17
0
mirror of https://github.com/MaSzyna-EU07/maszyna.git synced 2026-10-17 06:19:19 +02:00

refactor(sonar): use std::scoped_lock instead of std::lock_guard (cpp:S5997)

This commit is contained in:
jerrrrycho
2026-10-10 15:06:48 +02:00
parent 07d94806b7
commit 178fcc61a2
5 changed files with 13 additions and 13 deletions

View File

@@ -90,7 +90,7 @@ void ui::cameraview_panel::render_contents()
texture->bind(0);
{
std::lock_guard<std::mutex> lock(mutex);
std::scoped_lock lock(mutex);
if (image_ptr) {
glActiveTexture(GL_TEXTURE0);
@@ -142,7 +142,7 @@ void ui::cameraview_panel::capture_func()
bufpos = 0;
std::lock_guard<std::mutex> lock(mutex);
std::scoped_lock lock(mutex);
image_ptr = read_buffer;
read_buffer = active_buffer;
active_buffer = image_ptr;
@@ -151,7 +151,7 @@ void ui::cameraview_panel::capture_func()
notify_var.notify_one();
}
std::lock_guard<std::mutex> lock(mutex);
std::scoped_lock lock(mutex);
image_ptr = nullptr;
delete[] read_buffer;
delete[] active_buffer;