mirror of
https://github.com/tuxbox-fork-migrations/recycled-ni-neutrino.git
synced 2025-08-31 01:11:06 +02:00
add sigc disconnect() to destructor, avoid segfault if use new/delete CUpnpBrowserGui in other menu
Origin commit data
------------------
Commit: 547572e11e
Author: Jacek Jendrzej <overx300@gmail.com>
Date: 2020-01-24 (Fri, 24 Jan 2020)
This commit is contained in:
@@ -83,8 +83,8 @@ CUpnpBrowserGui::CUpnpBrowserGui()
|
|||||||
image = NULL;
|
image = NULL;
|
||||||
|
|
||||||
sigc::slot0<void> reinit = sigc::mem_fun(this, &CUpnpBrowserGui::Init);
|
sigc::slot0<void> reinit = sigc::mem_fun(this, &CUpnpBrowserGui::Init);
|
||||||
CNeutrinoApp::getInstance()->OnAfterSetupFonts.connect(reinit);
|
sigFonts = CNeutrinoApp::getInstance()->OnAfterSetupFonts.connect(reinit);
|
||||||
CFrameBuffer::getInstance()->OnAfterSetPallette.connect(reinit);
|
sigPall = CFrameBuffer::getInstance()->OnAfterSetPallette.connect(reinit);
|
||||||
}
|
}
|
||||||
|
|
||||||
void CUpnpBrowserGui::Init()
|
void CUpnpBrowserGui::Init()
|
||||||
@@ -164,12 +164,16 @@ void CUpnpBrowserGui::Init()
|
|||||||
|
|
||||||
CUpnpBrowserGui::~CUpnpBrowserGui()
|
CUpnpBrowserGui::~CUpnpBrowserGui()
|
||||||
{
|
{
|
||||||
|
sigFonts.disconnect();
|
||||||
|
sigPall.disconnect();
|
||||||
|
|
||||||
delete m_socket;
|
delete m_socket;
|
||||||
if (dline){
|
if (dline){
|
||||||
delete dline; dline = NULL;
|
delete dline; dline = NULL;
|
||||||
}
|
}
|
||||||
if (image)
|
if (image){
|
||||||
delete image, image = NULL;
|
delete image, image = NULL;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
int CUpnpBrowserGui::exec(CMenuTarget* parent, const std::string & /*actionKey*/)
|
int CUpnpBrowserGui::exec(CMenuTarget* parent, const std::string & /*actionKey*/)
|
||||||
|
Reference in New Issue
Block a user