[evolution-patches] [gtkhtml] #61997 Crash when viewing HTML message with embedded flash
- From: Radek Doulík <rodo novell com>
- To: Patches <evolution-patches ximian com>
- Cc: Larry Ewing <lewing ximian com>
- Subject: [evolution-patches] [gtkhtml] #61997 Crash when viewing HTML message with embedded flash
- Date: Wed, 28 Jul 2004 14:01:55 +0200
attached patch fixes #61997.
the embedded widget was finalized in the process of destroying htmlembedded object (when we didn't get it after object_requested signal), but was later used in the parser. the fix refs the widget when pushing it to the stack and unrefs when removing from the stack. that way we keep the reference all the time we need the embedded widget.
Index: ChangeLog
===================================================================
RCS file: /cvs/gnome/gtkhtml/src/ChangeLog,v
retrieving revision 1.2025
diff -u -p -r1.2025 ChangeLog
--- ChangeLog 22 Jul 2004 13:04:30 -0000 1.2025
+++ ChangeLog 28 Jul 2004 11:56:12 -0000
@@ -1,3 +1,10 @@
+2004-07-28 Radek Doulik <rodo ximian com>
+
+ * htmlengine.c: ref embedded widget when pushing it to the
+ embedded stack and unref it when poping back
+
+ Fixes #61997
+
2004-07-20 Radek Doulik <rodo ximian com>
* htmlengine-edit-text.c (set_link): do not leak memory - free
Index: htmlengine.c
===================================================================
RCS file: /cvs/gnome/gtkhtml/src/htmlengine.c,v
retrieving revision 1.615
diff -u -p -r1.615 htmlengine.c
--- htmlengine.c 22 Jul 2004 13:15:14 -0000 1.615
+++ htmlengine.c 28 Jul 2004 11:56:14 -0000
@@ -1416,8 +1416,10 @@ parse_object_params(HTMLEngine *p, HTMLO
static void
block_end_object (HTMLEngine *e, HTMLObject *clue, HTMLElement *elem)
{
- if (!html_stack_is_empty (e->embeddedStack))
- html_stack_pop (e->embeddedStack);
+ if (!html_stack_is_empty (e->embeddedStack)) {
+ GObject *o = G_OBJECT (html_stack_pop (e->embeddedStack));
+ g_object_unref (o);
+ }
}
static void
@@ -1473,6 +1475,7 @@ element_parse_object (HTMLEngine *e, HTM
width, height);
html_stack_push (e->embeddedStack, eb);
+ g_object_ref (eb);
el = html_embedded_new_widget (GTK_WIDGET (e->widget), eb, e);
/* evaluate params */
@@ -3812,6 +3815,10 @@ html_engine_finalize (GObject *object)
}
if (engine->embeddedStack) {
+ while (!html_stack_is_empty (engine->embeddedStack)) {
+ GObject *o = G_OBJECT (html_stack_pop (engine->embeddedStack));
+ g_object_unref (o);
+ }
html_stack_destroy (engine->embeddedStack);
engine->embeddedStack = NULL;
}
@@ -4618,7 +4625,7 @@ html_engine_stream_end (GtkHTMLStream *s
g_signal_emit (e, signals [LOAD_DONE], 0);
}
-void
+static void
html_engine_draw_real (HTMLEngine *e, gint x, gint y, gint width, gint height, gboolean expose)
{
gint x1, x2, y1, y2;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]