Made Filestorage able to not own its CvFileStorage instance.
This allows to get rid of the last remaining Ptr<T>::addref calls.
This commit is contained in:
@@ -186,7 +186,7 @@ public:
|
||||
//! the full constructor that opens file storage for reading or writing
|
||||
CV_WRAP FileStorage(const String& source, int flags, const String& encoding=String());
|
||||
//! the constructor that takes pointer to the C FileStorage structure
|
||||
FileStorage(CvFileStorage* fs);
|
||||
FileStorage(CvFileStorage* fs, bool owning=true);
|
||||
//! the destructor. calls release()
|
||||
virtual ~FileStorage();
|
||||
|
||||
|
@@ -5129,9 +5129,11 @@ FileStorage::FileStorage(const String& filename, int flags, const String& encodi
|
||||
open( filename, flags, encoding );
|
||||
}
|
||||
|
||||
FileStorage::FileStorage(CvFileStorage* _fs)
|
||||
FileStorage::FileStorage(CvFileStorage* _fs, bool owning)
|
||||
{
|
||||
fs = Ptr<CvFileStorage>(_fs);
|
||||
if (owning) fs.reset(_fs);
|
||||
else fs = Ptr<CvFileStorage>(Ptr<CvFileStorage>(), _fs);
|
||||
|
||||
state = _fs ? NAME_EXPECTED + INSIDE_MAP : UNDEFINED;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user