Questions and postings pertaining to the development of ImageMagick, feature enhancements, and ImageMagick internals. ImageMagick source code and algorithms are discussed here. Usage questions which are too arcane for the normal user list should also be posted here.
Magick++ uses standard C++ constructors / destructors. When the problem exits, the MagickCleanUp destructor is called which in turn calls MagickPlusPlusMagickCoreTerminus() which in turn calls MagickCore::MagickCoreTerminus() which cleans up all allocated memory. You should be able to call MagickPlusPlusMagickCoreTerminus() directly.
Note, we're always interested in memory leaks if you find them. Post code and a method to reproduce the leak so we can investigate.
Our regression tests include memory leak detection. Before each release we run thousands of tests and the release is not made if any leaks are revealed.
The project include/lib paths are relative, and assume that it is installed parallel to the IM directory. E.g. the following would be in the same sub-directory.
ImageMagick-6.4.5
MagickTest2
Notes:
- The leak seems related to the fact that I'm using MFC. I was unable to reproduce the problem when MFC wasn't in use.
- In this project the class MyTestClass calls Magick::InitializeMagick(NULL); in it's constructor, but the constructor is never executed because I never instantiate MyTestClass. There are no other Magick references, variables, etc anywhere in the project.
- I'm running this 32bit build under Windows Vista 64, IM 6.4.5 Dynamic w/ X11 stubs, Built under Visual Studio 2005.
magick wrote:Magick++ uses standard C++ constructors / destructors. When the problem exits, the MagickCleanUp destructor is called which in turn calls MagickPlusPlusMagickCoreTerminus() which in turn calls MagickCore::MagickCoreTerminus() which cleans up all allocated memory. You should be able to call MagickPlusPlusMagickCoreTerminus() directly.
Note, we're always interested in memory leaks if you find them. Post code and a method to reproduce the leak so we can investigate.
Our regression tests include memory leak detection. Before each release we run thousands of tests and the release is not made if any leaks are revealed.
I've been unable to determine how to call any of these methods from within a Magick++ application. E.g. Magick:: or Magick::Image namespaces don't appear to contain any of these methods. I'm guessing that I'm missing something obvious.
I have no doubt that you guys do a great job of testing. It's why I assumed that I was doing something incorrectly and made the post in the Developers forum instead of the Bug forum. You guys do a *great* job with IM.
The leak seems related to the fact that I'm using MFC. I was unable to reproduce the problem when MFC wasn't in use.
Its possible the Magick++ destructor is not being called. We use valgrind under Linux to track memory leaks. If you can produce a stand alone Magick++ program that leaks we would be interested. We're using
OK... I did some more digging today. It turns out that the Memory Check/Dump gets called when MFC exits. Since the IM DLLs haven't unloaded already, it thinks there is a memory leak.
This is pure and simple a bug in the MFC libraries.