mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-21 01:01:43 +00:00
Allow Sink.SetSource() to be given an empty source.
In Java, allow source to be null (pointers are not used in C++, so this isn't necessary).
This commit is contained in:
@@ -671,9 +671,9 @@ void MjpegServerImpl::SetSourceImpl(std::shared_ptr<SourceImpl> source) {
|
||||
if (auto thr = connThread.GetThread()) {
|
||||
if (thr->m_source != source) {
|
||||
bool streaming = thr->m_streaming;
|
||||
if (streaming) thr->m_source->DisableSink();
|
||||
if (thr->m_source && streaming) thr->m_source->DisableSink();
|
||||
thr->m_source = source;
|
||||
if (streaming) thr->m_source->EnableSink();
|
||||
if (source && streaming) thr->m_source->EnableSink();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user