We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 7f1498c commit 103b8a8Copy full SHA for 103b8a8
core/src/main/java/edu/wpi/grip/core/sources/CameraSource.java
@@ -333,7 +333,12 @@ public void onSourceRemovedEvent(SourceRemovedEvent event) throws InterruptedExc
333
TimeoutException, IOException {
334
if (event.getSource() == this) {
335
try {
336
- this.stopAsync();
+ // Stop the camera service and wait for it to terminate.
337
+ // If we just use stopAsync(), the camera service won't always have terminated by the time
338
+ // a new camera source is added. For webcam sources, this means that the video stream
339
+ // won't be freed and new sources won't be able to connect to the webcam until the
340
+ // application is closed.
341
+ this.stopAndAwait();
342
} finally {
343
this.eventBus.unregister(this);
344
}
0 commit comments