I used valgrind to check for memory leaks. When I checked my application with "--leak-check=full --show-reachable=yes -v", it showed tons of errors. However when I looked at the error verbose message, it showed that the ones causing the leak is not my application, but the libraries I was using. Eg, I used SDL for the graphics and CUPS for printing. Valgrind showed a leak on the "SDL_Init()" line from my application. But I am certain that I called "SDL_Quit()" in the destructor of my application. And valgrind not only showed one error from this SDL_Init() line, but many. So valgrind showed approximately 10 message of errors from this line. The same applies to the CUPS library. I made a class to manage the printing. In its constructor, I called cupsGetDests() and store the result to a private member. And in the destructor, I called cupsFreeDests() to free that variable. But valgrind showed a bunch of errors from the "cupsGetDests()" line. Why does this happen?
Thanks in advance.