aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorsaturneric <[email protected]>2024-07-26 16:41:17 +0000
committersaturneric <[email protected]>2024-07-26 16:41:17 +0000
commitca3a64b4a53d85f9b9ce7c3e9a93ae06affa158b (patch)
tree0f779c36b9b924da8af602cfaa00f4da5cf80103
parentfix: clean up warnings (diff)
downloadGpgFrontend-ca3a64b4a53d85f9b9ce7c3e9a93ae06affa158b.tar.gz
GpgFrontend-ca3a64b4a53d85f9b9ce7c3e9a93ae06affa158b.zip
fix: indirect memory leak issues
-rw-r--r--src/core/model/GFDataExchanger.cpp6
-rw-r--r--src/ui/main_window/MainWindowUI.cpp2
-rw-r--r--src/ui/widgets/KeyList.cpp14
3 files changed, 12 insertions, 10 deletions
diff --git a/src/core/model/GFDataExchanger.cpp b/src/core/model/GFDataExchanger.cpp
index d847b65d..c0da517d 100644
--- a/src/core/model/GFDataExchanger.cpp
+++ b/src/core/model/GFDataExchanger.cpp
@@ -42,8 +42,10 @@ auto GFDataExchanger::Write(const std::byte* buffer, size_t size) -> ssize_t {
not_empty_.notify_all();
}
- not_full_.wait(lock,
- [=] { return queue_.size() < queue_max_size_ || close_; });
+ not_full_.wait(lock, [=] {
+ return queue_.size() < static_cast<unsigned long>(queue_max_size_) ||
+ close_;
+ });
if (close_) return -1;
queue_.push(buffer[i]);
diff --git a/src/ui/main_window/MainWindowUI.cpp b/src/ui/main_window/MainWindowUI.cpp
index c1189fa2..2633a50d 100644
--- a/src/ui/main_window/MainWindowUI.cpp
+++ b/src/ui/main_window/MainWindowUI.cpp
@@ -681,7 +681,7 @@ void MainWindow::create_tool_bars() {
}
void MainWindow::create_status_bar() {
- auto* status_bar_box = new QWidget();
+ auto* status_bar_box = new QWidget(this);
auto* status_bar_box_layout = new QHBoxLayout();
// QPixmap* pixmap;
diff --git a/src/ui/widgets/KeyList.cpp b/src/ui/widgets/KeyList.cpp
index f3db2d15..6ddf62a3 100644
--- a/src/ui/widgets/KeyList.cpp
+++ b/src/ui/widgets/KeyList.cpp
@@ -69,9 +69,9 @@ void KeyList::init() {
KeyMenuAbility::kCOLUMN_FILTER);
ui_->searchBarEdit->setHidden(~menu_ability_ & KeyMenuAbility::kSEARCH_BAR);
- auto* column_type_menu = new QMenu();
+ auto* column_type_menu = new QMenu(this);
- key_id_column_action_ = new QAction(tr("Key ID"));
+ key_id_column_action_ = new QAction(tr("Key ID"), this);
key_id_column_action_->setCheckable(true);
key_id_column_action_->setChecked(
(global_column_filter_ & GpgKeyTableColumn::kKEY_ID) !=
@@ -82,7 +82,7 @@ void KeyList::init() {
: global_column_filter_ & ~GpgKeyTableColumn::kKEY_ID);
});
- algo_column_action_ = new QAction(tr("Algorithm"));
+ algo_column_action_ = new QAction(tr("Algorithm"), this);
algo_column_action_->setCheckable(true);
algo_column_action_->setChecked(
(global_column_filter_ & GpgKeyTableColumn::kALGO) !=
@@ -93,7 +93,7 @@ void KeyList::init() {
: global_column_filter_ & ~GpgKeyTableColumn::kALGO);
});
- owner_trust_column_action_ = new QAction(tr("Owner Trust"));
+ owner_trust_column_action_ = new QAction(tr("Owner Trust"), this);
owner_trust_column_action_->setCheckable(true);
owner_trust_column_action_->setChecked(
(global_column_filter_ & GpgKeyTableColumn::kOWNER_TRUST) !=
@@ -105,7 +105,7 @@ void KeyList::init() {
: global_column_filter_ & ~GpgKeyTableColumn::kOWNER_TRUST);
});
- create_date_column_action_ = new QAction(tr("Create Date"));
+ create_date_column_action_ = new QAction(tr("Create Date"), this);
create_date_column_action_->setCheckable(true);
create_date_column_action_->setChecked(
(global_column_filter_ & GpgKeyTableColumn::kCREATE_DATE) !=
@@ -117,7 +117,7 @@ void KeyList::init() {
: global_column_filter_ & ~GpgKeyTableColumn::kCREATE_DATE);
});
- subkeys_number_column_action_ = new QAction("Subkey(s)");
+ subkeys_number_column_action_ = new QAction("Subkey(s)", this);
subkeys_number_column_action_->setCheckable(true);
subkeys_number_column_action_->setChecked(
(global_column_filter_ & GpgKeyTableColumn::kSUBKEYS_NUMBER) !=
@@ -131,7 +131,7 @@ void KeyList::init() {
: global_column_filter_ & ~GpgKeyTableColumn::kSUBKEYS_NUMBER);
});
- comment_column_action_ = new QAction("Comment");
+ comment_column_action_ = new QAction("Comment", this);
comment_column_action_->setCheckable(true);
comment_column_action_->setChecked(
(global_column_filter_ & GpgKeyTableColumn::kCOMMENT) !=