diff options
author | Stig Bjørlykke <stig@bjorlykke.org> | 2015-09-05 19:53:04 +0200 |
---|---|---|
committer | Stig Bjørlykke <stig@bjorlykke.org> | 2015-09-08 06:32:27 +0000 |
commit | e4383749906bf7ecdf221ba02d9793990865cf26 (patch) | |
tree | 666df2a755bd75e3c4ffe1a6d5f15f7c5b5dc334 /ui/qt/proto_tree.cpp | |
parent | 91d863cc1612453d4ed1c7629738d3057ea61373 (diff) |
Qt: Fixed a resource leak in updateSelectionStatus
Avoid passing a reference to a allocated QString, which will
never be deleted.
This fixes a 16 Bytes leak each time an element is selected or
deselected in the packet tree.
Change-Id: If0d7482bf505fda8802dd58e8d1841b7da6b6294
Reviewed-on: https://code.wireshark.org/review/10393
Petri-Dish: Stig Bjørlykke <stig@bjorlykke.org>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Stig Bjørlykke <stig@bjorlykke.org>
Diffstat (limited to 'ui/qt/proto_tree.cpp')
-rw-r--r-- | ui/qt/proto_tree.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/ui/qt/proto_tree.cpp b/ui/qt/proto_tree.cpp index 8e84ee288f..961cf577e0 100644 --- a/ui/qt/proto_tree.cpp +++ b/ui/qt/proto_tree.cpp @@ -359,6 +359,7 @@ void ProtoTree::goToField(int hf_id) } void ProtoTree::updateSelectionStatus(QTreeWidgetItem* item) { + static const QString emptyQString; if (item) { field_info *fi; @@ -384,7 +385,7 @@ void ProtoTree::updateSelectionStatus(QTreeWidgetItem* item) { item_info.append(QString(tr(", %1 bytes")).arg(finfo_length)); } - emit protoItemSelected(*new QString()); + emit protoItemSelected(emptyQString); emit protoItemSelected(NULL); emit protoItemSelected(item_info); emit protoItemSelected(fi); @@ -410,7 +411,7 @@ void ProtoTree::updateSelectionStatus(QTreeWidgetItem* item) { */ } else { - emit protoItemSelected(*new QString()); + emit protoItemSelected(emptyQString); emit protoItemSelected(NULL); } } |