I have a class for a discovery application (one method of which initializes the necessary buffers). The class is dynamically created and the init and run method is called when the button is clicked. It works great.
However, if I finish the discovery and return to the GUI and try to click the button again to create a new discovery class and run it again, the application will fail.
It gets stuck when calling cvCreateMemStorage (). The problem is illustrated here:
problem http://img573.imageshack.us/img573/9498/problemp.jpg
1st time, works fine. 2nd time, a problem!
The first time the modelStorage model is initialized correctly. The second time this is not so. If the discovery class were finished, the entire storage on the heap would be deleted, and could I make a call to cvCreateMemStorage () in the new class?
I also tried to free the modelStorage memory when I finished by setting cvReleaseMemStorage (& modelStorage); in the classes of the destructor BUT, but not joy. It is like the memory will not be allocated correctly.
So, the beautiful inhabitants of stackoverflow, any ideas ?: (
source
share