From 173a66346b662c17e8e49bbccc6bdd412b54d262 Mon Sep 17 00:00:00 2001 From: Gregor Bollerhey Date: Wed, 8 Jan 2014 00:31:03 +0100 Subject: [PATCH] Thought BadWindow was a return status on failure. In fact its 0, thats why fluxbox sometimes crashes when freeing the malformed structure. --- src/SystemTray.cc | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/src/SystemTray.cc b/src/SystemTray.cc index 6efb8126..1c88836b 100644 --- a/src/SystemTray.cc +++ b/src/SystemTray.cc @@ -599,13 +599,11 @@ static int client_to_ordinal(const std::vector left, // based on the parsed order list and a given window returns an // ordinal used to sort the tray icons. - auto Xdeleter = [](XClassHint *x){XFree(x);}; - - std::unique_ptr - xclasshint (XAllocClassHint(), Xdeleter); + std::unique_ptr + xclasshint(XAllocClassHint(), XFree); if(XGetClassHint(Fluxbox::instance()->display(), - i->window(), xclasshint.get()) != BadWindow) + i->window(), xclasshint.get())) { std::string classname(xclasshint.get()->res_class);