Discard reply in ~Wraper if not yet retrieved

Ensures that we don't leak replies.
icc-effect-5.14.5
Martin Gräßlin 2013-01-14 09:11:18 +01:00
parent b3885dcb99
commit 1e47911ab0
1 changed files with 5 additions and 0 deletions

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();