diff --git a/widget/src/gtk/nsAppShell.cpp b/widget/src/gtk/nsAppShell.cpp index 4dfee8ffc91..d968e4a5aaf 100644 --- a/widget/src/gtk/nsAppShell.cpp +++ b/widget/src/gtk/nsAppShell.cpp @@ -332,6 +332,17 @@ NS_IMETHODIMP nsAppShell::Spindown() return NS_OK; } +#ifdef NS_TRACE_MALLOC +#include "nsTraceMalloc.h" + +static gint +tm_flush_logfiles(gpointer data) +{ + NS_TraceMallocFlushLogfiles(); + return 1; +} +#endif + //------------------------------------------------------------------------- // // Run @@ -345,6 +356,10 @@ NS_IMETHODIMP nsAppShell::Run() if (!mEventQueue) return NS_ERROR_NOT_INITIALIZED; +#ifdef NS_TRACE_MALLOC + gtk_idle_add(tm_flush_logfiles, nsnull); +#endif + // kick up gtk_main. this won't return until gtk_main_quit is called gtk_main();