Discard reply in ~Wraper if not yet retrieved

Ensures that we don't leak replies.
This commit is contained in:
Martin Gräßlin 2013-01-14 09:11:18 +01:00
parent b3885dcb99
commit 1e47911ab0

View file

@ -46,6 +46,11 @@ public:
, m_window(window)
{
}
virtual ~Wrapper() {
if (!m_retrieved) {
xcb_discard_reply(connection(), m_cookie.sequence);
}
}
inline const Reply *operator->() {
getReply();