Skip to content
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

Merged
merged 1 commit into from
Nov 18, 2024

Conversation

GermanAizek
Copy link

fixed direct memleaks

@@ -102,6 +102,11 @@ PredefinedFiltersComboBox::PredefinedFiltersComboBox( QWidget* parent )
setSizeAdjustPolicy( QComboBox::AdjustToContents );
}

PredefinedFiltersComboBox::~PredefinedFiltersComboBox()
{
delete model_;
Copy link
Owner

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.

Copy link
Author

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;
Copy link
Owner

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.

Copy link
Author

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_;
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good find!

Copy link
Author

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?

@GermanAizek
Copy link
Author

@variar, oh my goh!
Thank you're alive. I was already going to make fork, but I couldn't devote time to it myself. Moreover, I would not be sure that I am correcting it correctly.

@variar variar merged commit 2f2be80 into variar:master Nov 18, 2024
7 of 13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants