forked from qt-creator/qt-creator
Core: Fix memory leak in InfoBarEntry
Use like
InfoBarEntry info(id, text);
info.setShowDefaultCancelButton(false);
leaked the infoWidgetCloseButton.
Fix the memory leak and improve the API to avoid inconsistent state.
Change-Id: If2e06a8a5239e4f902a883da82122c3a27df48a6
Reviewed-by: David Schulz <david.schulz@qt.io>
This commit is contained in:
@@ -140,7 +140,7 @@ static InfoBarEntry createMinimizableInfo(const Id &id,
|
||||
QTC_CHECK(minimizer);
|
||||
|
||||
InfoBarEntry info(id, text);
|
||||
info.setShowDefaultCancelButton(false);
|
||||
info.removeCancelButton();
|
||||
// The minimizer() might delete the "Minimize" button immediately and as
|
||||
// result invalid reads will happen in QToolButton::mouseReleaseEvent().
|
||||
// Avoid this by running the minimizer in the next event loop iteration.
|
||||
|
||||
Reference in New Issue
Block a user