GHOST: Fix memory leak in X11 DPI query
authorSergey Sharybin <sergey.vfx@gmail.com>
Tue, 10 Jul 2018 08:59:06 +0000 (10:59 +0200)
committerSergey Sharybin <sergey.vfx@gmail.com>
Tue, 10 Jul 2018 08:59:06 +0000 (10:59 +0200)
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

intern/ghost/intern/GHOST_WindowX11.cpp

index 933bcd7f0122b79d7e41547985525502f1ded0cb..dc701062df86fab3cbae3b568a7216e4504c84ec 100644 (file)
@@ -1697,6 +1697,7 @@ getDPIHint()
                                }
                        }
                }
+               XrmDestroyDatabase(xrdb);
        }
 
        /* Fallback to calculating DPI using X reported DPI, set using xrandr --dpi */