From 9b079df3f139618f9b47a130c31ea3cfdf42a76f Mon Sep 17 00:00:00 2001 From: Jian Liang Date: Mon, 16 Dec 2013 21:33:01 +0800 Subject: Fix QAccessibleStateChangeEvent object leak Allocate QAccessibleStateChangeEvent object on stack in QGroupBox::setChecked() to prevent leak. Change-Id: I6b189b9c4ce6b542d6f9f1041018c39a13a8c31f Reviewed-by: Thiago Macieira --- src/widgets/widgets/qgroupbox.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/widgets/widgets/qgroupbox.cpp b/src/widgets/widgets/qgroupbox.cpp index 14d434ec28..168f0bbd67 100644 --- a/src/widgets/widgets/qgroupbox.cpp +++ b/src/widgets/widgets/qgroupbox.cpp @@ -645,8 +645,8 @@ void QGroupBox::setChecked(bool b) #ifndef QT_NO_ACCESSIBILITY QAccessible::State st; st.checked = true; - QAccessibleStateChangeEvent *ev = new QAccessibleStateChangeEvent(this, st); - QAccessible::updateAccessibility(ev); + QAccessibleStateChangeEvent e(this, st); + QAccessible::updateAccessibility(&e); #endif emit toggled(b); } -- cgit v1.2.3