1
0
mirror of https://github.com/f4exb/sdrangel.git synced 2026-06-02 06:04:39 -04:00

Deep redesign: corrections after Valgrind memcheck

This commit is contained in:
f4exb
2015-08-29 03:09:44 +02:00
parent 43a783aceb
commit cebedf1460
5 changed files with 23 additions and 5 deletions
+17 -4
View File
@@ -32,7 +32,8 @@ const PluginDescriptor BlderfPlugin::m_pluginDescriptor = {
};
BlderfPlugin::BlderfPlugin(QObject* parent) :
QObject(parent)
QObject(parent),
m_pluginAPI(0)
{
}
@@ -51,6 +52,7 @@ PluginInterface::SampleSourceDevices BlderfPlugin::enumSampleSources()
{
SampleSourceDevices result;
struct bladerf_devinfo *devinfo;
int count = bladerf_get_device_list(&devinfo);
for(int i = 0; i < count; i++)
@@ -61,16 +63,27 @@ PluginInterface::SampleSourceDevices BlderfPlugin::enumSampleSources()
s.writeString(2, devinfo[i].serial);
result.append(SampleSourceDevice(displayedName, "org.osmocom.sdr.samplesource.bladerf", s.final()));
}
bladerf_free_device_list(devinfo); // Valgrind memcheck
return result;
}
PluginGUI* BlderfPlugin::createSampleSourcePluginGUI(const QString& sourceName, const QByteArray& address)
{
if(sourceName == "org.osmocom.sdr.samplesource.bladerf") {
if (!m_pluginAPI)
{
return 0;
}
if(sourceName == "org.osmocom.sdr.samplesource.bladerf")
{
BladerfGui* gui = new BladerfGui(m_pluginAPI);
m_pluginAPI->setInputGUI(gui);
return gui;
} else {
return NULL;
}
else
{
return 0;
}
}