From d79bfbc1a41ad501b9497ec4a3361c3bf0b8724e Mon Sep 17 00:00:00 2001 From: Jacek Jendrzej Date: Fri, 24 Jan 2020 22:04:09 +0100 Subject: [PATCH] add sigc disconnect() to destructor, avoid segfault if use new/delete CUpnpBrowserGui in other menu Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/547572e11ed2db626032b2a5dc38b3325a0e5ba2 Author: Jacek Jendrzej Date: 2020-01-24 (Fri, 24 Jan 2020) --- src/gui/upnpbrowser.cpp | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/gui/upnpbrowser.cpp b/src/gui/upnpbrowser.cpp index a469f5e65..9f938a8c2 100644 --- a/src/gui/upnpbrowser.cpp +++ b/src/gui/upnpbrowser.cpp @@ -83,8 +83,8 @@ CUpnpBrowserGui::CUpnpBrowserGui() image = NULL; sigc::slot0 reinit = sigc::mem_fun(this, &CUpnpBrowserGui::Init); - CNeutrinoApp::getInstance()->OnAfterSetupFonts.connect(reinit); - CFrameBuffer::getInstance()->OnAfterSetPallette.connect(reinit); + sigFonts = CNeutrinoApp::getInstance()->OnAfterSetupFonts.connect(reinit); + sigPall = CFrameBuffer::getInstance()->OnAfterSetPallette.connect(reinit); } void CUpnpBrowserGui::Init() @@ -164,12 +164,16 @@ void CUpnpBrowserGui::Init() CUpnpBrowserGui::~CUpnpBrowserGui() { + sigFonts.disconnect(); + sigPall.disconnect(); + delete m_socket; if (dline){ delete dline; dline = NULL; } - if (image) + if (image){ delete image, image = NULL; + } } int CUpnpBrowserGui::exec(CMenuTarget* parent, const std::string & /*actionKey*/)