Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit4564b8a

Browse files
authored
Merge pull request#17841 from vpisarev:fixed_fs_dtor
* fixed issue#17412* Update test_io.cpp
1 parent9b7b22e commit4564b8a

File tree

2 files changed

+16
-1
lines changed

2 files changed

+16
-1
lines changed

‎modules/core/src/persistence.cpp‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1819,7 +1819,6 @@ void FileStorage::endWriteStruct()
18191819

18201820
FileStorage::~FileStorage()
18211821
{
1822-
p.release();
18231822
}
18241823

18251824
boolFileStorage::open(const String& filename,int flags,const String& encoding)

‎modules/core/test/test_io.cpp‎

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1772,4 +1772,20 @@ TEST(Core_InputOutput, FileStorage_open_empty_16823)
17721772
EXPECT_EQ(0,remove(fname.c_str()));
17731773
}
17741774

1775+
TEST(Core_InputOutput, FileStorage_copy_constructor_17412)
1776+
{
1777+
std::string fname =tempfile("test.yml");
1778+
FileStoragefs_orig(fname, cv::FileStorage::WRITE);
1779+
fs_orig <<"string" <<"wat";
1780+
fs_orig.release();
1781+
1782+
// no crash anymore
1783+
cv::FileStorage fs;
1784+
fs =cv::FileStorage(fname, cv::FileStorage::READ);
1785+
std::string s;
1786+
fs["string"] >> s;
1787+
EXPECT_EQ(s,"wat");
1788+
EXPECT_EQ(0,remove(fname.c_str()));
1789+
}
1790+
17751791
}}// namespace

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp