all repos — fluxbox @ 7a404e7fbca7894cdda76f7b0ddfed855a732424

custom fork of the fluxbox windowmanager

Store XClassHint on stack, not in dynamic memory
Vladimir A. Pavlov pv4@bk.ru
commit

7a404e7fbca7894cdda76f7b0ddfed855a732424

parent

9f995b7f1974eabfe09b029f890059e689ec1397

1 files changed, 4 insertions(+), 7 deletions(-)

jump to
M util/fbrun/FbRun.ccutil/fbrun/FbRun.cc

@@ -79,14 +79,11 @@ // setting nomaximize in local resize

resize(width, font().height() + m_bevel); // setup class name - XClassHint *class_hint = XAllocClassHint(); - if (class_hint == 0) - throw string("Out of memory"); - class_hint->res_name = const_cast<char *>("fbrun"); - class_hint->res_class = const_cast<char *>("FbRun"); - XSetClassHint(m_display, window(), class_hint); + XClassHint ch; + ch.res_name = const_cast<char *>("fbrun"); + ch.res_class = const_cast<char *>("FbRun"); + XSetClassHint(m_display, window(), &ch); - XFree(class_hint); #ifdef HAVE_XPM Pixmap mask = 0; Pixmap pm;