From 8ecc20993480a10c940a95393a5992834df1f94a Mon Sep 17 00:00:00 2001 From: f4exb Date: Thu, 28 Dec 2017 10:58:50 +0100 Subject: [PATCH] Web API: fixed segfault on device and channel GETs --- sdrbase/webapi/webapirequestmapper.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sdrbase/webapi/webapirequestmapper.cpp b/sdrbase/webapi/webapirequestmapper.cpp index 310f248f6..18cdbf4df 100644 --- a/sdrbase/webapi/webapirequestmapper.cpp +++ b/sdrbase/webapi/webapirequestmapper.cpp @@ -1515,6 +1515,7 @@ void WebAPIRequestMapper::appendSettingsSubKeys( void WebAPIRequestMapper::resetDeviceSettings(SWGSDRangel::SWGDeviceSettings& deviceSettings) { deviceSettings.cleanup(); + deviceSettings.setDeviceHwType(0); deviceSettings.setFileSourceSettings(0); deviceSettings.setRtlSdrSettings(0); deviceSettings.setLimeSdrInputSettings(0); @@ -1524,6 +1525,7 @@ void WebAPIRequestMapper::resetDeviceSettings(SWGSDRangel::SWGDeviceSettings& de void WebAPIRequestMapper::resetChannelSettings(SWGSDRangel::SWGChannelSettings& channelSettings) { channelSettings.cleanup(); + channelSettings.setChannelType(0); channelSettings.setNfmDemodSettings(0); channelSettings.setNfmModSettings(0); }