From 6c2363b23925dd029ddb1fbbc2e369891a51b243 Mon Sep 17 00:00:00 2001 From: dijunkun Date: Thu, 13 Jun 2024 16:30:25 +0800 Subject: [PATCH] Clear render buffer when connection closed --- src/main_window/main_window_callback_func.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/main_window/main_window_callback_func.cpp b/src/main_window/main_window_callback_func.cpp index 0d110bf..16c15ca 100644 --- a/src/main_window/main_window_callback_func.cpp +++ b/src/main_window/main_window_callback_func.cpp @@ -167,6 +167,11 @@ void MainWindow::OnConnectionStatusCb(ConnectionStatus status, main_window->start_screen_capture_ = false; main_window->start_mouse_control_ = false; main_window->connection_established_ = false; + if (main_window->dst_buffer_) { + memset(main_window->dst_buffer_, 0, 1280 * 720 * 3); + SDL_UpdateTexture(main_window->sdl_texture_, NULL, + main_window->dst_buffer_, 1280); + } } else if (ConnectionStatus::IncorrectPassword == status) { main_window->connection_status_str_ = "Incorrect password"; if (main_window->connect_button_pressed_) {