Try
private void Window_Closing(object sender, System.ComponentModel.CancelEventArgs e)
{
webcamPlayer.Device.Dispose();
}
It will work.