This is nice, since it lets me quickly launch a test app
and terminate it with Ctrl-C and still produce a usable
sysprof trace.
#include "config.h"
#include <sys/types.h>
+#include <signal.h>
#ifdef HAVE_UNISTD_H
#include <unistd.h>
static gboolean running = FALSE;
static void
-profiler_stop (void)
+profiler_stop (int s)
{
if (writer)
sysprof_capture_writer_unref (writer);
if (writer)
running = TRUE;
- atexit (profiler_stop);
+ atexit (G_CALLBACK (profiler_stop));
+ signal (SIGTERM, profiler_stop);
}
void