diff --git a/modules/core/doc/xml_yaml_persistence.rst b/modules/core/doc/xml_yaml_persistence.rst index 8011aefce5..c7d55d01f5 100644 --- a/modules/core/doc/xml_yaml_persistence.rst +++ b/modules/core/doc/xml_yaml_persistence.rst @@ -201,6 +201,15 @@ Closes the file and releases all the memory buffers. .. ocv:function:: void FileStorage::release() +Call this method after all I/O operations with the storage are finished. + + +FileStorage::releaseAndGetString +-------------------------------- +Closes the file and releases all the memory buffers. + +.. ocv:function:: string FileStorage::releaseAndGetString() + Call this method after all I/O operations with the storage are finished. If the storage was opened for writing data and ``FileStorage::WRITE`` was specified diff --git a/modules/core/src/persistence.cpp b/modules/core/src/persistence.cpp index c880aa882f..049b7fb7da 100644 --- a/modules/core/src/persistence.cpp +++ b/modules/core/src/persistence.cpp @@ -5202,13 +5202,11 @@ string FileStorage::releaseAndGetString() string buf; if( fs.obj && fs.obj->outbuf ) icvClose(fs.obj, &buf); - - fs.release(); - structs.clear(); - state = UNDEFINED; - return buf; -} - + + release(); + return buf; +} + FileNode FileStorage::root(int streamidx) const { return isOpened() ? FileNode(fs, cvGetRootFileNode(fs, streamidx)) : FileNode(); diff --git a/modules/highgui/src/cap_dshow.cpp b/modules/highgui/src/cap_dshow.cpp index a177e72311..49c8463037 100644 --- a/modules/highgui/src/cap_dshow.cpp +++ b/modules/highgui/src/cap_dshow.cpp @@ -3278,7 +3278,7 @@ bool CvCaptureCAM_DShow::setProperty( int property_id, double value ) case CV_CAP_PROP_FPS: int fps = cvRound(value); - if (fps != VI.getFPS(0)) + if (fps != VI.getFPS(index)) { VI.stopDevice(index); VI.setIdealFramerate(index,fps);