From: Lars Op den Kamp Date: Fri, 23 Mar 2012 16:01:36 +0000 (+0100) Subject: cec: fix crash on exit after GetDeviceInformation() X-Git-Tag: upstream/2.2.0~1^2~31^2~50 X-Git-Url: https://git.piment-noir.org/?a=commitdiff_plain;h=f3b6afa4b5b7637741592ce4535e34e04e68cb6a;p=deb_libcec.git cec: fix crash on exit after GetDeviceInformation() --- diff --git a/src/lib/CECProcessor.cpp b/src/lib/CECProcessor.cpp index 4685132..6e5bf19 100644 --- a/src/lib/CECProcessor.cpp +++ b/src/lib/CECProcessor.cpp @@ -1692,5 +1692,6 @@ bool CCECProcessor::GetDeviceInformation(const char *strPort, libcec_configurati config->iPhysicalAddress = m_communication->GetPhysicalAddress(); delete m_communication; + m_communication = NULL; return true; } diff --git a/src/testclient/main.cpp b/src/testclient/main.cpp index c9a74d7..d4c0ed9 100644 --- a/src/testclient/main.cpp +++ b/src/testclient/main.cpp @@ -207,8 +207,8 @@ void ListDevices(ICECAdapter *parser) PrintToStdOut("WARNING: unable to open the device on port %s", devices[iDevicePtr].comm); else strDeviceInfo.AppendFormat("firmware version: %d\n", config.iFirmwareVersion); + strDeviceInfo.append("\n"); } - PrintToStdOut(strDeviceInfo.c_str()); } }