-
-
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
Conversation
@@ -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 comment
The 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 comment
The 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.
leave this change?
@@ -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 comment
The 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 comment
The 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.
leave this change?
@@ -536,9 +536,11 @@ AbstractLogView::~AbstractLogView() | |||
try { | |||
if ( quickFind_ ) { | |||
quickFind_->stopSearch(); | |||
delete quickFind_; |
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.
Good find!
leave this change?
@variar, oh my goh! |
fixed direct memleaks