[fix] do not forget to destroy the texture

This commit is contained in:
dijunkun
2024-09-11 17:35:27 +08:00
parent 9096769a85
commit fea545e5e7

View File

@@ -616,6 +616,7 @@ int Render::Run() {
texture_width_ = video_width_; texture_width_ = video_width_;
texture_height_ = video_height_; texture_height_ = video_height_;
SDL_DestroyTexture(stream_texture_);
stream_texture_ = SDL_CreateTexture( stream_texture_ = SDL_CreateTexture(
main_renderer_, stream_pixformat_, SDL_TEXTUREACCESS_STREAMING, main_renderer_, stream_pixformat_, SDL_TEXTUREACCESS_STREAMING,
texture_width_, texture_height_); texture_width_, texture_height_);
@@ -708,6 +709,7 @@ int Render::Run() {
ImGui_ImplSDLRenderer2_Shutdown(); ImGui_ImplSDLRenderer2_Shutdown();
ImGui_ImplSDL2_Shutdown(); ImGui_ImplSDL2_Shutdown();
SDL_DestroyTexture(stream_texture_);
SDL_DestroyRenderer(main_renderer_); SDL_DestroyRenderer(main_renderer_);
SDL_DestroyWindow(main_window_); SDL_DestroyWindow(main_window_);