forked from osmocom/wireshark
Qt: Plug memory leak in ByteViewText.
Each time we create a ByteViewText, which is twice when a packet is selected, the menu items leaks. Ensure we clear the items when done. Change-Id: Idf0c7b82bf241120dd4c42ba85c56c0a2bf8db46 Reviewed-on: https://code.wireshark.org/review/12826 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>
This commit is contained in:
parent
3bd69dac73
commit
2997178795
|
@ -86,6 +86,11 @@ ByteViewText::ByteViewText(QWidget *parent, tvbuff_t *tvb, proto_tree *tree, QTr
|
|||
setMouseTracking(true);
|
||||
}
|
||||
|
||||
ByteViewText::~ByteViewText()
|
||||
{
|
||||
ctx_menu_.clear();
|
||||
}
|
||||
|
||||
void ByteViewText::setEncoding(packet_char_enc encoding)
|
||||
{
|
||||
encoding_ = encoding;
|
||||
|
|
|
@ -43,6 +43,8 @@ class ByteViewText : public QAbstractScrollArea
|
|||
Q_OBJECT
|
||||
public:
|
||||
explicit ByteViewText(QWidget *parent = 0, tvbuff_t *tvb = NULL, proto_tree *tree = NULL, QTreeWidget *protoTree = NULL, packet_char_enc encoding = PACKET_CHAR_ENC_CHAR_ASCII);
|
||||
~ByteViewText();
|
||||
|
||||
bool hasDataSource(const tvbuff_t *ds_tvb = NULL);
|
||||
void setEncoding(packet_char_enc encoding);
|
||||
void setFormat(bytes_view_type format);
|
||||
|
|
Loading…
Reference in New Issue