[Bf-blender-cvs] [719629f2aa8] master: GHOST: Fix memory leak in X11 DPI query

Sergey Sharybin noreply at git.blender.org
Tue Jul 10 11:10:29 CEST 2018


Commit: 719629f2aa8cc146427b68bd6fcf422bdd1e52b0
Author: Sergey Sharybin
Date:   Tue Jul 10 10:59:06 2018 +0200
Branches: master
https://developer.blender.org/rB719629f2aa8cc146427b68bd6fcf422bdd1e52b0

GHOST: Fix memory leak in X11 DPI query

The X resource database is to be explicitly destroyed. This fixes 46 bytes
leak per every window DPI query (which happens a lot on window move/resize
and even on areas resize).

Unfortunately, this does not fully fix the leak since the known leak:

  https://bugs.freedesktop.org/show_bug.cgi?id=94604

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

M	intern/ghost/intern/GHOST_WindowX11.cpp

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

diff --git a/intern/ghost/intern/GHOST_WindowX11.cpp b/intern/ghost/intern/GHOST_WindowX11.cpp
index 933bcd7f012..dc701062df8 100644
--- a/intern/ghost/intern/GHOST_WindowX11.cpp
+++ b/intern/ghost/intern/GHOST_WindowX11.cpp
@@ -1697,6 +1697,7 @@ getDPIHint()
 				}
 			}
 		}
+		XrmDestroyDatabase(xrdb);
 	}
 
 	/* Fallback to calculating DPI using X reported DPI, set using xrandr --dpi */



More information about the Bf-blender-cvs mailing list