Itseez/opencv — pull request #1104 by nikman-ru (2013-07-10 14:10:21+00:00)
Title: Fixed "VideoCapture::open() does not release previous capture sources"

Bug #3150.

VideoCapture didn't call release method and just ignored the new capture sources.
OpenCV documentation:
bool VideoCapture::open(const string& filename);
bool VideoCapture::open(int device);

The methods first call VideoCapture::release() to close the already opened file or camera.