Wireshark-commits: [Wireshark-commits] master d8137cc: ProfileTreeView: fix a memory leak

From: Wireshark code review <code-review-do-not-reply@xxxxxxxxxxxxx>
Date: Sun, 26 Apr 2020 06:13:54 +0000
URL: https://code.wireshark.org/review/gitweb?p=wireshark.git;a=commit;h=d8137cc1be55f084b99332b967d1d1cab9324d5b
Submitter: "Anders Broman <a.broman58@xxxxxxxxx>"
Changed: branch: master
Repository: wireshark

Commits:

d8137cc by Martin Kaiser (wireshark@xxxxxxxxx):

    ProfileTreeView: fix a memory leak
    
    In the constructor, we allocate a delegate for the name column and assign
    it by calling QAbstractItemView::setItemDelegateForColumn(). This does
    not pass ownership of the delegate to QAbstractItemView, it's still
    up to us to free the delegate.
    
    ASAN warns about this
    
    Indirect leak of 48 byte(s) in 1 object(s) allocated from:
    ...
        #1 ... in ProfileTreeView::ProfileTreeView(QWidget*) ui/qt/widgets/profile_tree_view.cpp:46:17
        #2 ... in Ui_ProfileDialog::setupUi(QDialog*) ui/qt/qtui_autogen/include/ui_profile_dialog.h:67:31
        #3 ... in ProfileDialog::ProfileDialog(QWidget*) ui/qt/profile_dialog.cpp:59:13
        #4 ... in MainWindow::on_actionEditConfigurationProfiles_triggered() ui/qt/main_window_slots.cpp:2239:36
    
    Add a destructor for ProfileTreeView and free the delegate there.
    
    Change-Id: I2a76abb7ec174c91ad15bfac91f2b47bea29f511
    Reviewed-on: https://code.wireshark.org/review/36934
    Reviewed-by: Martin Kaiser <wireshark@xxxxxxxxx>
    Petri-Dish: Martin Kaiser <wireshark@xxxxxxxxx>
    Tested-by: Petri Dish Buildbot
    Reviewed-by: Anders Broman <a.broman58@xxxxxxxxx>
    

Actions performed:

    from  3485ad6   travis: fix macOS build.
     add  d8137cc   ProfileTreeView: fix a memory leak


Summary of changes:
 ui/qt/widgets/profile_tree_view.cpp | 5 +++++
 ui/qt/widgets/profile_tree_view.h   | 1 +
 2 files changed, 6 insertions(+)