Added changes suggested by bug #3186 : fixing the unplugging of webcam
Merge pull request #1376 from StevenPuttemans:bugfix_3186