Fix QAccessibleStateChangeEvent object leak

Allocate QAccessibleStateChangeEvent object on stack in
QGroupBox::setChecked() to prevent leak.

Change-Id: I6b189b9c4ce6b542d6f9f1041018c39a13a8c31f
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
This commit is contained in:
Jian Liang 2013-12-16 21:33:01 +08:00 committed by The Qt Project
parent 68ff352906
commit 9b079df3f1
1 changed files with 2 additions and 2 deletions

View File

@ -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);
}