From 27c23b557c3549ef51b015f5da7530c206734c63 Mon Sep 17 00:00:00 2001 From: Andrey Kamaev Date: Sat, 30 Jun 2012 13:36:27 +0000 Subject: [PATCH] Merged few small fixes from 2.4 branch --- modules/core/doc/xml_yaml_persistence.rst | 9 +++++++++ modules/core/src/persistence.cpp | 12 +++++------- modules/highgui/src/cap_dshow.cpp | 2 +- 3 files changed, 15 insertions(+), 8 deletions(-) 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);