Skip to content

Commit

Permalink
Fix webcam sources failing to stop when opening saved projects (#686)
Browse files Browse the repository at this point in the history
  • Loading branch information
SamCarlberg authored Oct 12, 2016
1 parent 7f1498c commit 103b8a8
Showing 1 changed file with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -333,7 +333,12 @@ public void onSourceRemovedEvent(SourceRemovedEvent event) throws InterruptedExc
TimeoutException, IOException {
if (event.getSource() == this) {
try {
this.stopAsync();
// Stop the camera service and wait for it to terminate.
// If we just use stopAsync(), the camera service won't always have terminated by the time
// a new camera source is added. For webcam sources, this means that the video stream
// won't be freed and new sources won't be able to connect to the webcam until the
// application is closed.
this.stopAndAwait();
} finally {
this.eventBus.unregister(this);
}
Expand Down

0 comments on commit 103b8a8

Please # to comment.