From e4bb9dc4375c1968420e8e4e29e90b953a4f39f3 Mon Sep 17 00:00:00 2001 From: Bastien Nocera Date: Mar 24 2010 11:40:07 +0000 Subject: - Fix possible crasher when countdown reaches zero --- diff --git a/cheese-countdown-crasher.patch b/cheese-countdown-crasher.patch new file mode 100644 index 0000000..a36a52b --- /dev/null +++ b/cheese-countdown-crasher.patch @@ -0,0 +1,70 @@ +From beee2792720f5a55820b9ce8df94d985c6d139d0 Mon Sep 17 00:00:00 2001 +From: Filippo Argiolas +Date: Wed, 24 Mar 2010 08:52:13 +0100 +Subject: [PATCH] countdown: move rsvg_init and rsvg_term into main + +Initialize rsvg at startup and clean it up at exit. +rsvg_term is particularly subtle as it calls xmlCleanupParser() +triggering nasty crashes (e.g. with PulseAudio) with multithread +applications. +See http://0pointer.de/blog/projects/beware-of-rsvg-term.html for more +info. +Rsvg loading seems to work even without these functions so I'm not sure +it's worth to keep them. + +https://bugzilla.gnome.org/show_bug.cgi?id=592100 +--- + libcheese/cheese-countdown.c | 3 --- + src/cheese.c | 10 ++++++++++ + 2 files changed, 10 insertions(+), 3 deletions(-) + +diff --git a/libcheese/cheese-countdown.c b/libcheese/cheese-countdown.c +index b2782e2..d849594 100644 +--- a/libcheese/cheese-countdown.c ++++ b/libcheese/cheese-countdown.c +@@ -504,8 +504,6 @@ create_surface_from_svg (GtkWidget *widget, gchar *pcFilename) + + CheeseCountdownPrivate *priv = CHEESE_COUNTDOWN_GET_PRIVATE (widget); + +- rsvg_init (); +- + /* load svg-file from disk */ + pSvgHandle = rsvg_handle_new_from_file (pcFilename, &pError); + if (!pSvgHandle) +@@ -546,7 +544,6 @@ create_surface_from_svg (GtkWidget *widget, gchar *pcFilename) + + /* clean up */ + rsvg_handle_free (pSvgHandle); +- rsvg_term (); + cairo_destroy (pContext); + + return pSurface; +diff --git a/src/cheese.c b/src/cheese.c +index 5e1c952..f143ecf 100644 +--- a/src/cheese.c ++++ b/src/cheese.c +@@ -110,6 +110,10 @@ main (int argc, char **argv) + g_thread_init (NULL); + gdk_threads_init (); + ++ /* initialize rsvg */ ++ /* needed to load the camera icon for the countdown widget */ ++ rsvg_init (); ++ + g_set_application_name (_("Cheese")); + + context = g_option_context_new (N_("- Take photos and videos with your webcam, with fun graphical effects")); +@@ -159,5 +163,11 @@ main (int argc, char **argv) + gtk_main (); + gdk_threads_leave (); + ++ /* cleanup rsvg */ ++ /* Note: this function is bad with multithread applications as it ++ * calls xmlCleanupParser() and should be only called right before ++ * exit */ ++ rsvg_term (); ++ + return 0; + } +-- +1.6.6.1 \ No newline at end of file diff --git a/cheese.spec b/cheese.spec index f898fb3..ac8acbf 100644 --- a/cheese.spec +++ b/cheese.spec @@ -1,6 +1,6 @@ Name: cheese Version: 2.29.92 -Release: 3%{?dist} +Release: 4%{?dist} Summary: Application for taking pictures and movies from a webcam Group: Amusements/Graphics @@ -12,6 +12,8 @@ Source0: http://download.gnome.org/sources/cheese/2.29/%{name}-%{version} Patch0: no-webcam.patch # https://bugzilla.gnome.org/show_bug.cgi?id=613287 Patch1: cheese-effects-i18n.patch +# https://bugzilla.gnome.org/show_bug.cgi?id=592100 +Patch2: cheese-countdown-crasher.patch BuildRequires: gtk2-devel >= 2.19.1 BuildRequires: dbus-devel @@ -67,6 +69,7 @@ for writing applications that require a webcam display widget. %setup -q %patch0 -p1 -b .no-webcam %patch1 -p1 -b .effects-i18n +%patch2 -p1 -b .countdown-crasher %build %configure --disable-static @@ -170,6 +173,9 @@ fi %{_libdir}/pkgconfig/cheese-gtk.pc %changelog +* Wed Mar 24 2010 Bastien Nocera 2.29.92-4 +- Fix possible crasher when countdown reaches zero + * Fri Mar 19 2010 Matthias Clasen 2.29.92-3 - Fix text rendering issues on the effects tab