Skip to content

Commit

Permalink
LimePlugin: destroy streams after stop, precheck if ports have assign…
Browse files Browse the repository at this point in the history
…ed devices
  • Loading branch information
rjonaitis committed Dec 20, 2024
1 parent 327bc0f commit ebfb21e
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion src/API/LimePlugin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -241,7 +241,14 @@ static OpStatus MapChannelsToDevices(
int port_channel_count = dir == TRXDir::Tx ? params.rf_ports[p].tx_channel_count : params.rf_ports[p].rx_channel_count;

std::deque<DevNode*> assignedDevices;
copy(ports[p].nodes.begin(), ports[p].nodes.end(), assignedDevices.begin());
for (const auto& iter : ports[p].nodes)
assignedDevices.push_back(iter);

if (assignedDevices.empty())
{
Log(LogLevel::Error, "No devices are assigned to ports.");
return OpStatus::Error;
}

int remainingChannels = assignedDevices.front()->configInputs.maxChannelsToUse;
int chipRelativeChannelIndex = 0;
Expand Down Expand Up @@ -304,7 +311,10 @@ int LimePlugin_Stop(LimePluginContext* context)
for (auto& port : context->ports)
{
if (port.stream)
{
port.stream->Stop();
port.stream.reset();
}
}
return 0;
}
Expand Down

0 comments on commit ebfb21e

Please sign in to comment.