fix(renderer): Destroy window on deconstruct

This commit is contained in:
Michael Carlberg 2016-11-25 11:41:41 +01:00
parent 4268817c51
commit 6f2b437be3
2 changed files with 10 additions and 0 deletions

View File

@ -16,6 +16,7 @@ class renderer {
explicit renderer(connection& conn, const logger& logger, unique_ptr<font_manager> font_manager,
const bar_settings& bar, const vector<string>& fonts);
~renderer();
xcb_window_t window() const;

View File

@ -128,6 +128,15 @@ renderer::renderer(connection& conn, const logger& logger, unique_ptr<font_manag
}
}
/**
* Deconstruct instance
*/
renderer::~renderer() {
if (m_window != XCB_NONE) {
m_connection.destroy_window(m_window);
}
}
/**
* Get output window
*/