-
-
Notifications
You must be signed in to change notification settings - Fork 210
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: fixed memleaks and predefinedfilterscombobox and abstractlogview #730
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -102,6 +102,11 @@ PredefinedFiltersComboBox::PredefinedFiltersComboBox( QWidget* parent ) | |
setSizeAdjustPolicy( QComboBox::AdjustToContents ); | ||
} | ||
|
||
PredefinedFiltersComboBox::~PredefinedFiltersComboBox() | ||
{ | ||
delete model_; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Setting this as a parent for the model object in PredefinedFiltersComboBox constructor is a more "Qt" way to manage this without creating explicit destructors. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
leave this change? |
||
} | ||
|
||
void PredefinedFiltersComboBox::populatePredefinedFilters() | ||
{ | ||
model_->clear(); | ||
|
@@ -172,6 +177,7 @@ void PredefinedFiltersComboBox::setTitle( const QString& title ) | |
{ | ||
auto* titleItem = new QStandardItem( title ); | ||
model_->insertRow( 0, titleItem ); | ||
delete titleItem; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. As far as I understand after insertRow call the ownership should be transferred to the model. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
leave this change? |
||
} | ||
|
||
void PredefinedFiltersComboBox::insertFilters( | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good find!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
leave this change?