diff --git a/src/gui/gui-bar.c b/src/gui/gui-bar.c index 03c03932b..e7fc5a5d4 100644 --- a/src/gui/gui-bar.c +++ b/src/gui/gui-bar.c @@ -842,8 +842,7 @@ gui_bar_config_change_hidden (const void *pointer, void *data, { if (CONFIG_BOOLEAN(ptr_bar->options[GUI_BAR_OPTION_HIDDEN])) { - if (ptr_bar->bar_window) - gui_bar_window_free (ptr_bar->bar_window, NULL); + gui_bar_window_free (ptr_bar->bar_window, NULL); } else { diff --git a/tests/unit/gui/test-gui-bar-window.cpp b/tests/unit/gui/test-gui-bar-window.cpp index 075f8eff1..568bf5d4c 100644 --- a/tests/unit/gui/test-gui-bar-window.cpp +++ b/tests/unit/gui/test-gui-bar-window.cpp @@ -382,7 +382,9 @@ TEST(GuiBarWindow, SetCurrentSize) TEST(GuiBarWindow, Free) { - /* TODO: write tests */ + /* test free of NULL bar window */ + gui_bar_window_free (NULL, gui_current_window); + gui_bar_window_free (NULL, NULL); } /*