I have installed gtkmm trough vcpkg. (gtkmm 3.22.2-2 and gtk 3.22.19-3) If I try to compile simple example provided in gnome tutorials. It shows memory leak at the end of the execution. Some people said its not leak, gnome intentionally leaves releasing the allocated resources to operationg system as an optimization. And a similar problem reported in Debian using valgrind. Well, I cannot distinguish real leaks with gnome optimizaton ... I want to learn how can I properly exit from a gnome app. Here is my way of checking leaks with CRT memdebug utilities.
#include <gtkmm.h>
#define _CRTDBG_MAP_ALLOC
#include <stdlib.h>
#include <crtdbg.h>
#ifdef _DEBUG
#define DBG_NEW new ( _NORMAL_BLOCK , __FILE__ , __LINE__ )
#else
#define DBG_NEW new
#endif
int main(int argc, char* argv[])
{
_CrtSetDbgFlag(_CRTDBG_ALLOC_MEM_DF | _CRTDBG_LEAK_CHECK_DF);
{
auto app = Gtk::Application::create(argc, argv, "org.gtkmm.examples.base");
Gtk::Window window;
window.set_default_size(200, 200);
app->run(window);
}
return 0;
}