From aa1120804708c44ac72e20e228d5ef383a1cd62a Mon Sep 17 00:00:00 2001 From: "Bradley T. Hughes" Date: Mon, 15 Jun 2009 17:45:01 +0200 Subject: Fix memory leak when detaching QTouchEventTouchPointPrivate When detaching, we need to deref the original data to prevent us from leaking it. --- src/gui/kernel/qevent_p.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/gui/kernel/qevent_p.h b/src/gui/kernel/qevent_p.h index 2a481fb..47082d1 100644 --- a/src/gui/kernel/qevent_p.h +++ b/src/gui/kernel/qevent_p.h @@ -103,6 +103,8 @@ public: { QTouchEventTouchPointPrivate *d = new QTouchEventTouchPointPrivate(*this); d->ref = 1; + if (!this->ref.deref()) + delete this; return d; } -- cgit v0.12