[gtkhtml/gnome-2-30] Bug #344076 - Crash after closing an inline view of text attachment



commit d43a84424361bcf8657459b6e2023b513322414d
Author: Chenthill Palanisamy <pchenthill novell com>
Date:   Wed Jun 9 12:27:32 2010 +0530

    Bug #344076 - Crash after closing an inline view of text attachment

 gtkhtml/htmlembedded.c |   11 ++++++-----
 1 files changed, 6 insertions(+), 5 deletions(-)
---
diff --git a/gtkhtml/htmlembedded.c b/gtkhtml/htmlembedded.c
index 7b618dd..730fde8 100644
--- a/gtkhtml/htmlembedded.c
+++ b/gtkhtml/htmlembedded.c
@@ -75,22 +75,23 @@ draw (HTMLObject *o,
 		return;
 
 	if (element->parent) {
+		GtkWidget *parent;
 		new_x = o->x + tx;
 		new_y = o->y + ty - o->ascent;
 
-		if (gtk_widget_get_parent (element->widget)) {
+		if ((parent = gtk_widget_get_parent (element->widget))) {
 			if (new_x != element->abs_x || new_y != element->abs_y) {
 				d (printf ("element: %p moveto: %d,%d shown: %d\n", element, new_x, new_y, GTK_WIDGET_VISIBLE (element->widget)));
-				gtk_layout_move (GTK_LAYOUT(element->parent), element->widget, new_x, new_y);
-			} else if (!GTK_HTML (element->parent)->engine->expose)
+				gtk_layout_move (GTK_LAYOUT(parent), element->widget, new_x, new_y);
+			} else if (!GTK_HTML (parent)->engine->expose)
 				gtk_widget_queue_draw (element->widget);
 		}
 
 		element->abs_x = new_x;
 		element->abs_y = new_y;
 
-		if (!gtk_widget_get_parent (element->widget)) {
-			d (printf ("element: %p put: %d,%d shown: %d\n", element, new_x, new_y, GTK_WIDGET_VISIBLE (element->widget)));
+		if (!parent) {
+			d(printf ("element: %p put: %d,%d shown: %d\n", element, new_x, new_y, GTK_WIDGET_VISIBLE (element->widget)));
 			gtk_layout_put (GTK_LAYOUT(element->parent), element->widget, new_x, new_y);
 		}
 	}



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]