Example #1
0
void cleanup()
{
	HAGGLE_DBG("Cleaning up\n");

	if (kernel)
		delete kernel;

#ifdef DEBUG_LEAKS
	/*
		There seems to be some artificial limit in printf statements
		on Windows mobile. If the leak report is printed here using
		the HAGGLE_DBG macro nothing will be printed.
		Using the cout stream is slow but seems to work ok.

                However, on some platforms we do not have STL, so we use printf
                here anyway.
	*/
	printf("===== Leak report ===\n");
	LeakMonitor::reportLeaks();
	printf("=====================\n");
#endif
#if defined(OS_UNIX) && !defined(OS_ANDROID)
	resettty();
#endif
#ifdef OS_WINDOWS_MOBILE
	tray_notification_remove();
#endif
        if (shouldCleanupPidFile)
                cleanup_pid_file();
}
Example #2
0
void cleanup()
{
	HAGGLE_DBG("Cleaning up\n");

	if (kernel)
		delete kernel;

#ifdef DEBUG_LEAKS
	/*
		There seems to be some artificial limit in printf statements
		on Windows mobile. If the leak report is printed here using
		the HAGGLE_DBG macro nothing will be printed.
		Using the cout stream is slow but seems to work ok.

                However, on some platforms we do not have STL, so we use printf
                here anyway.
	*/
	printf("===== Leak report ===\n");
	LeakMonitor::reportLeaks();
	printf("=====================\n");
#endif
#if defined(OS_UNIX) && !defined(OS_ANDROID)
	resettty();
#endif
#ifdef OS_WINDOWS_MOBILE
	tray_notification_remove();
#endif
        if (shouldCleanupPidFile)
                cleanup_pid_file();

    // SW: HACK: ideally this should go elsewhere, we put it here 
    // for the meanwhile to remove detected memory leaks in 
    // in libxml2 from valgrind (some library data structures).
    XMLMetadata::shutdown_cleanup();
    SecurityManager::shutdown_cleanup();

    // MOS
    HAGGLE_LOG("\n\n****************** SHUTDOWN COMPLETED *********************\n\n");
}