[Bf-blender-cvs] [5409b0b0be7] vr_scene_inspection: Fix two memory leaks in OpenGL Linux (X11) graphics binding

Julian Eisel noreply at git.blender.org
Fri Dec 13 11:32:32 CET 2019


Commit: 5409b0b0be7ce1c7b97d360dfd935f4b24a18093
Author: Julian Eisel
Date:   Fri Dec 13 11:31:45 2019 +0100
Branches: vr_scene_inspection
https://developer.blender.org/rB5409b0b0be7ce1c7b97d360dfd935f4b24a18093

Fix two memory leaks in OpenGL Linux (X11) graphics binding

===================================================================

M	intern/ghost/intern/GHOST_IXrGraphicsBinding.h
M	intern/ghost/intern/GHOST_XrGraphicsBinding.cpp

===================================================================

diff --git a/intern/ghost/intern/GHOST_IXrGraphicsBinding.h b/intern/ghost/intern/GHOST_IXrGraphicsBinding.h
index 4cc71d19f21..7ad7e7935c8 100644
--- a/intern/ghost/intern/GHOST_IXrGraphicsBinding.h
+++ b/intern/ghost/intern/GHOST_IXrGraphicsBinding.h
@@ -41,6 +41,8 @@ class GHOST_IXrGraphicsBinding {
 #endif
   } oxr_binding;
 
+  virtual ~GHOST_IXrGraphicsBinding() = default;
+
   /**
    * Does __not__ require this object is initialized (can be called prior to
    * #initFromGhostContext). It's actually meant to be called first.
diff --git a/intern/ghost/intern/GHOST_XrGraphicsBinding.cpp b/intern/ghost/intern/GHOST_XrGraphicsBinding.cpp
index 87cc2ddd899..dd3d477ef8c 100644
--- a/intern/ghost/intern/GHOST_XrGraphicsBinding.cpp
+++ b/intern/ghost/intern/GHOST_XrGraphicsBinding.cpp
@@ -126,6 +126,8 @@ class GHOST_XrGraphicsBindingOpenGL : public GHOST_IXrGraphicsBinding {
 
     /* Generate a framebuffer to use for blitting into the texture. */
     glGenFramebuffers(1, &m_fbo);
+
+    XFree(visual_info);
   }
 
   bool chooseSwapchainFormat(const std::vector<int64_t> &runtime_formats,



More information about the Bf-blender-cvs mailing list