cvmat_release_bug.cc
1 | #include <iostream> |
---|---|
2 | #include <opencv2/opencv.hpp> |
3 | |
4 | using namespace cv; |
5 | using namespace std; |
6 | |
7 | int main(int argc, char** argv) { |
8 | Mat m = Mat::zeros(3, 3, CV_64F); |
9 | m.at<double>(1,1) = 42; |
10 | cout << "m.data : " << (uint64_t)m.data << endl;
|
11 | m.addref(); |
12 | cout << "m.refcount : " << *m.refcount << endl;
|
13 | m.release(); |
14 | |
15 | cout << "m.data : " << (uint64_t)m.data << endl;
|
16 | } |
17 | |
18 |