|
static class member deallocation: msg#00734lib.opencv
Hello, I use a CvMat* as static class member. The memory is allocated within the static variable declaration (see code below). CvMat* MultiCameraModel::Camera_Param_Common_System::m_geometry = cvCreateMat(3,3,CV_64F); With the given code, there is a memory leak, because the data from CvMat* is not free'd. Where or how can i deallocate the memory for the static CvMat* (I know that it is done via cvReleaseMat)? Doing it in the destructor-function would be a bad idea, since it has a static lifetime. best regards, gerd //HEADER FILE namespace MultiCameraModel { class Camera_Param_Common_System { public: Camera_Param_Common_System(void); ~Camera_Param_Common_System(void); Camera_Param_Common_System(const MultiCameraModel::Camera_Param_Common_System& another); const MultiCameraModel::Camera_Param_Common_System& operator=(const MultiCameraModel::Camera_Param_Common_System& right); private: //static members static CvMat* m_geometry; }; } //SOURCE FILE //DEFINITION FOR STATIC VARIABLES CvMat* MultiCameraModel::Camera_Param_Common_System::m_geometry = cvCreateMat(3,3,CV_64F); MultiCameraModel::Camera_Param_Common_System::Camera_Param_Common_System(void) { } MultiCameraModel::Camera_Param_Common_System::~Camera_Param_Common_System(void) { } MultiCameraModel::Camera_Param_Common_System::Camera_Param_Common_System(const MultiCameraModel::Camera_Param_Common_System& another) { } const MultiCameraModel::Camera_Param_Common_System& MultiCameraModel::Camera_Param_Common_System::operator=(const MultiCameraModel::Camera_Param_Common_System& right) { } Change settings: http://www.yahoogroups.com/mygroups, select Get Emails (get all posts) Daily Digest (one summary email per day) Read on the web (read posts on the web only)Or Unsubscribe by mailing OpenCV-unsubscribe@xxxxxxxxxxxxxxx |
|
| <Prev in Thread] | Current Thread | [Next in Thread> |
|---|---|---|
| Previous by Date: | Re: facedetect.c: 00734, cegparamesh |
|---|---|
| Next by Date: | Re: Re: Surface defects detection - Ideas?: 00734, Luiz Curado |
| Previous by Thread: | can we use a simple usb webcam with opencvi: 00734, madhurchadha |
| Next by Thread: | Python in Windows: 00734, tulio_c2001 |
| Indexes: | [Date] [Thread] [Top] [All Lists] |
| News | FAQ | advertise |