All lms_stream_t objects of one device share the single apiDevice->stream, created once in LMS_SetupStream. LMS_DestroyStream resets it unconditionally, without consulting the other channels' maskChannelsSetup. The remaining SubChannelHandle objects stay valid with their setup and active bits set, so LMS_StartStream, LMS_StopStream, LMS_GetStreamStatus, ReceiveStream and SendStream all dereference a null unique_ptr afterwards.
The same function also searches the saved config with the raw stream->channel, while LMS_SetupStream stored stream->channel & ~LMS_ALIGN_CH_PHASE, so a channel set up with the align-phase flag is never erased from lastSavedStreamConfig.
All
lms_stream_tobjects of one device share the singleapiDevice->stream, created once inLMS_SetupStream.LMS_DestroyStreamresets it unconditionally, without consulting the other channels'maskChannelsSetup. The remainingSubChannelHandleobjects stay valid with their setup and active bits set, soLMS_StartStream,LMS_StopStream,LMS_GetStreamStatus,ReceiveStreamandSendStreamall dereference a nullunique_ptrafterwards.The same function also searches the saved config with the raw
stream->channel, whileLMS_SetupStreamstoredstream->channel & ~LMS_ALIGN_CH_PHASE, so a channel set up with the align-phase flag is never erased fromlastSavedStreamConfig.