Skip to content

Commit fac6df9

Browse files
Yixin ZhuYixin Zhu
Yixin Zhu
authored and
Yixin Zhu
committed
fix memory leak in rgbdalign
1 parent ee742d6 commit fac6df9

File tree

2 files changed

+10
-0
lines changed

2 files changed

+10
-0
lines changed

Diff for: Pipeline/RGBDAlign.exe

512 Bytes
Binary file not shown.

Diff for: RGBDAlign/rgb2depth.cpp

+10
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,8 @@ int main(void)
9494
cv::Mat cvColorShowImage;
9595
cv::resize(cvColorOriImage, cvColorShowImage, cv::Size(), 0.25, 0.25);
9696
cv::imshow("Original Color Image", cvColorShowImage);
97+
98+
cvColorShowImage.release();
9799
}
98100

99101
// load depth image
@@ -107,6 +109,8 @@ int main(void)
107109
cv::Mat adjMap;
108110
cv::convertScaleAbs(cvDepthDispImage, adjMap, 255 / 1000.0);
109111
cv::imshow("Original Depth Image", adjMap);
112+
113+
cvDepthDispImage.release();
110114
}
111115

112116
// load mapper file
@@ -137,6 +141,12 @@ int main(void)
137141
cv::imwrite(colorImageFilename.str().c_str(), cvColorMapperImage);
138142
}
139143

144+
// release memory
145+
cvColorOriImage.release();
146+
cvColorMapperImage.release();
147+
cvReleaseImage(&cvDepthImage);
148+
cvReleaseImage(&cvMapperImage);
149+
140150
cv::waitKey(33);
141151
}
142152

0 commit comments

Comments
 (0)