Skip to content

Commit

Permalink
fix: fixed memleaks and predefinedfilterscombobox and abstractlogview
Browse files Browse the repository at this point in the history
  • Loading branch information
GermanAizek committed Aug 28, 2024
1 parent edc7582 commit 54d565d
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/ui/include/predefinedfilterscombobox.h
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ class PredefinedFiltersComboBox final : public QComboBox {

public:
explicit PredefinedFiltersComboBox( QWidget* parent );
~PredefinedFiltersComboBox();

PredefinedFiltersComboBox( const PredefinedFiltersComboBox& other ) = delete;
PredefinedFiltersComboBox( PredefinedFiltersComboBox&& other ) noexcept = delete;
Expand Down
2 changes: 2 additions & 0 deletions src/ui/src/abstractlogview.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -536,9 +536,11 @@ AbstractLogView::~AbstractLogView()
try {
if ( quickFind_ ) {
quickFind_->stopSearch();
delete quickFind_;
}
} catch ( const std::exception& e ) {
LOG_ERROR << "Failed to stop search: " << e.what();
delete quickFind_;
}
}

Expand Down
6 changes: 6 additions & 0 deletions src/ui/src/predefinedfilterscombobox.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,11 @@ PredefinedFiltersComboBox::PredefinedFiltersComboBox( QWidget* parent )
setSizeAdjustPolicy( QComboBox::AdjustToContents );
}

PredefinedFiltersComboBox::~PredefinedFiltersComboBox()
{
delete model_;
}

void PredefinedFiltersComboBox::populatePredefinedFilters()
{
model_->clear();
Expand Down Expand Up @@ -172,6 +177,7 @@ void PredefinedFiltersComboBox::setTitle( const QString& title )
{
auto* titleItem = new QStandardItem( title );
model_->insertRow( 0, titleItem );
delete titleItem;
}

void PredefinedFiltersComboBox::insertFilters(
Expand Down

0 comments on commit 54d565d

Please sign in to comment.