aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorGregor Bollerhey <gbsoftware@arcor.de>2014-01-07 23:31:03 (GMT)
committerJan Sucan <jan@jansucan.com>2020-04-05 07:47:18 (GMT)
commit173a66346b662c17e8e49bbccc6bdd412b54d262 (patch)
treea1f4b21f9bf8cfd132880a15652921024005bc9d /src
parent35ce8b313a8fd99c0f8d77e237a66c869fe44f74 (diff)
downloadfluxbox-173a66346b662c17e8e49bbccc6bdd412b54d262.zip
fluxbox-173a66346b662c17e8e49bbccc6bdd412b54d262.tar.bz2
Thought BadWindow was a return status on failure.
In fact its 0, thats why fluxbox sometimes crashes when freeing the malformed structure.
Diffstat (limited to 'src')
-rw-r--r--src/SystemTray.cc8
1 files changed, 3 insertions, 5 deletions
diff --git a/src/SystemTray.cc b/src/SystemTray.cc
index 6efb812..1c88836 100644
--- a/src/SystemTray.cc
+++ b/src/SystemTray.cc
@@ -599,13 +599,11 @@ static int client_to_ordinal(const std::vector<std::string> left,
599 // based on the parsed order list and a given window returns an 599 // based on the parsed order list and a given window returns an
600 // ordinal used to sort the tray icons. 600 // ordinal used to sort the tray icons.
601 601
602 auto Xdeleter = [](XClassHint *x){XFree(x);}; 602 std::unique_ptr<XClassHint, int(*)(void*)>
603 603 xclasshint(XAllocClassHint(), XFree);
604 std::unique_ptr<XClassHint, decltype(Xdeleter)>
605 xclasshint (XAllocClassHint(), Xdeleter);
606 604
607 if(XGetClassHint(Fluxbox::instance()->display(), 605 if(XGetClassHint(Fluxbox::instance()->display(),
608 i->window(), xclasshint.get()) != BadWindow) 606 i->window(), xclasshint.get()))
609 { 607 {
610 std::string classname(xclasshint.get()->res_class); 608 std::string classname(xclasshint.get()->res_class);
611 609