[retro-gtk] environment: Clear the HW renderer before setting it



commit 78cbe31ee823b7eba4ada3a087de6a50cd1d4d25
Author: Adrien Plazas <kekun plazas laposte net>
Date:   Sun Aug 1 11:37:47 2021 +0200

    environment: Clear the HW renderer before setting it
    
    This avoids leaks if the core  happens to set the hardware render
    interface multiple times.

 retro-runner/retro-environment.c | 2 ++
 1 file changed, 2 insertions(+)
---
diff --git a/retro-runner/retro-environment.c b/retro-runner/retro-environment.c
index a2bba0d..c6857c6 100644
--- a/retro-runner/retro-environment.c
+++ b/retro-runner/retro-environment.c
@@ -493,6 +493,8 @@ set_hw_render (RetroCore             *self,
   g_assert (self);
   g_return_val_if_fail (callback, FALSE);
 
+  g_clear_object (&self->renderer);
+
   switch (callback->context_type) {
   case RETRO_HW_CONTEXT_OPENGL:
   case RETRO_HW_CONTEXT_OPENGL_CORE:


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]