From 0cde5bf1f5ba7fdc402a544deee9c53fae0002bf Mon Sep 17 00:00:00 2001 From: Benjamin Otte Date: Thu, 4 Oct 2007 16:05:44 +0200 Subject: [PATCH] add a -g option to cause garbage collection as often as possible FIXME: Do we want to have this as a flag accepting maximum memory between GCing? --- player/swfplay.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/player/swfplay.c b/player/swfplay.c index b5b7b073..4b9cf03a 100644 --- a/player/swfplay.c +++ b/player/swfplay.c @@ -106,12 +106,13 @@ main (int argc, char *argv[]) GError *error = NULL; gboolean use_image = FALSE, no_sound = FALSE; gboolean trace = FALSE, no_scripts = FALSE; - gboolean redraws = FALSE; + gboolean redraws = FALSE, gc = FALSE; char *variables = NULL; char *s; GtkWidget *window; GOptionEntry options[] = { + { "always-gc", 'g', 0, G_OPTION_ARG_NONE, &gc, "run the garbage collector as often as possible", NULL }, { "delay", 'd', 0, G_OPTION_ARG_INT, &delay, "make loading of resources take time", "SECS" }, { "image", 'i', 0, G_OPTION_ARG_NONE, &use_image, "use an intermediate image surface for drawing", NULL }, { "no-scripts", 0, 0, G_OPTION_ARG_NONE, &no_scripts, "don't execute scripts affecting the application", NULL }, @@ -153,6 +154,8 @@ main (int argc, char *argv[]) } loop = g_main_loop_new (NULL, TRUE); player = swfdec_gtk_player_new (NULL); + if (gc) + g_object_set (player, "memory-until-gc", (gulong) 0, NULL); if (trace) g_signal_connect (player, "trace", G_CALLBACK (print_trace), NULL); swfdec_gtk_player_set_speed (SWFDEC_GTK_PLAYER (player), speed / 100.); -- 2.11.4.GIT