From c65f2ec6fbaea0d844b29470d2ce2891ffc5d2c4 Mon Sep 17 00:00:00 2001 From: Gregor Bollerhey Date: Sun, 15 Dec 2013 03:40:22 +0100 Subject: [PATCH] Use XFree to free memory (not the default "delete"). --- src/SystemTray.cc | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/SystemTray.cc b/src/SystemTray.cc index 4b2cf56a..a5fcc791 100644 --- a/src/SystemTray.cc +++ b/src/SystemTray.cc @@ -592,7 +592,11 @@ static int client_to_ordinal(const std::vector left, const std::vector right, TrayWindow *i) { - std::unique_ptr xclasshint (XAllocClassHint()); + auto Xdeleter = [](XClassHint *x){XFree(x);}; + + std::unique_ptr + xclasshint (XAllocClassHint(), Xdeleter); + if(XGetClassHint(Fluxbox::instance()->display(), i->window(), xclasshint.get()) != BadWindow) {