[anjal] Redo the way we cancel handlers.



commit a04ba6ecf5318d79559f749c1814775a87c362ff
Author: Srinivasa Ragavan <sragavan novell com>
Date:   Fri Jul 24 00:22:00 2009 +0530

    Redo the way we cancel handlers.

 src/em-webkit-stream.c |   10 ++++++----
 1 files changed, 6 insertions(+), 4 deletions(-)
---
diff --git a/src/em-webkit-stream.c b/src/em-webkit-stream.c
index ddffc28..7097e2f 100644
--- a/src/em-webkit-stream.c
+++ b/src/em-webkit-stream.c
@@ -89,8 +89,9 @@ em_webkit_stream_finalize (CamelObject *object)
 {
 	EMWebKitStream *emws = (EMWebKitStream *)object;
 
-	if (emws->view)
+	if (emws->view) {
 		g_object_weak_unref ((GObject *)emws->view, (GWeakNotify)emws_weak_notify, object);
+	}
 	g_string_free (emws->buffer, TRUE);
 	camel_stream_close((CamelStream *)emws);
 }
@@ -101,7 +102,8 @@ emws_sync_write(CamelStream *stream, const char *buffer, size_t n)
 	EMWebKitStream *emws = EM_WEBKIT_STREAM (stream);
 
 	g_string_append (emws->buffer, buffer);
-	webkit_web_view_load_html_string (emws->view, emws->buffer->str, "");
+	if (emws->view)
+		webkit_web_view_load_html_string (emws->view, emws->buffer->str, "");
 	return (ssize_t) n;
 }
 
@@ -117,9 +119,9 @@ static int
 emws_sync_close(CamelStream *stream)
 {
 	EMWebKitStream *emws = (EMWebKitStream *)stream;
-	if (emws->view && webkit_web_frame_get_height(webkit_web_view_get_main_frame(emws->view)))
-		gtk_widget_set_size_request ((GtkWidget *)emws->view, -1, webkit_web_frame_get_height(webkit_web_view_get_main_frame(emws->view)));
 
+	if (emws->view && WEBKIT_IS_WEB_VIEW (emws->view)&&webkit_web_frame_get_height(webkit_web_view_get_main_frame(emws->view)))
+		gtk_widget_set_size_request ((GtkWidget *)emws->view, -1, webkit_web_frame_get_height(webkit_web_view_get_main_frame(emws->view)));
 	return 0;
 }
 



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