From 50f20a545209edddd6e0743e6dbef922727b26b5 Mon Sep 17 00:00:00 2001 From: "Srivats P." Date: Fri, 7 Nov 2014 20:21:02 +0530 Subject: [PATCH] During stream configuration - when deleting a protocol, delete its associated widget also, otherwise if a newly allocated protocol gets the same heap address as the old protocol, the old protocol's widget gets associated with the new protocol. Fixes issue 131 --- client/streamconfigdialog.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/client/streamconfigdialog.cpp b/client/streamconfigdialog.cpp index 2458372..32a4ca7 100644 --- a/client/streamconfigdialog.cpp +++ b/client/streamconfigdialog.cpp @@ -516,6 +516,8 @@ void StreamConfigDialog::on_tbDelete_clicked() Q_CHECK_PTR(p); _iter->remove(); + // Free both protocol and associated widget + delete _protocolWidgets.take(p); delete p; updateSelectProtocolsAdvancedWidget(); @@ -835,6 +837,8 @@ void StreamConfigDialog::__updateProtocol(int level, int newId) newId, mpStream)); else _iter->remove(); + // Free both protocol and associated widget + delete _protocolWidgets.take(p); delete p; if (level == ProtoPayload) { @@ -842,6 +846,8 @@ void StreamConfigDialog::__updateProtocol(int level, int newId) { p = _iter->next(); _iter->remove(); + // Free both protocol and associated widget + delete _protocolWidgets.take(p); delete p; } }