[kazehakase-svn] [3833] 2009-09-08 Hiroyuki Ikezoe <poinc****@ikezo*****>

Back to archive index

svnno****@sourc***** svnno****@sourc*****
Tue Sep 8 12:10:08 JST 2009


Revision: 3833
          http://sourceforge.jp/projects/kazehakase/svn/view?view=rev&revision=3833
Author:   ikezoe
Date:     2009-09-08 12:10:08 +0900 (Tue, 08 Sep 2009)

Log Message:
-----------
2009-09-08  Hiroyuki Ikezoe  <poinc****@ikezo*****>

	* src/actions/kz-actions.c: Fix memory leak.
	* module/embed/webkit-gtk/kz-webkit-gtk.c: Free variables
	in finalize() instead of dispose().

Modified Paths:
--------------
    kazehakase/trunk/ChangeLog
    kazehakase/trunk/module/embed/webkit-gtk/kz-webkit-gtk.c
    kazehakase/trunk/src/actions/kz-actions.c

Modified: kazehakase/trunk/ChangeLog
===================================================================
--- kazehakase/trunk/ChangeLog	2009-09-04 04:00:38 UTC (rev 3832)
+++ kazehakase/trunk/ChangeLog	2009-09-08 03:10:08 UTC (rev 3833)
@@ -1,3 +1,9 @@
+2009-09-08  Hiroyuki Ikezoe  <poinc****@ikezo*****>
+
+	* src/actions/kz-actions.c: Fix memory leak.
+	* module/embed/webkit-gtk/kz-webkit-gtk.c: Free variables
+	in finalize() instead of dispose().
+
 2009-09-04  Hiroyuki Ikezoe  <poinc****@ikezo*****>
 
 	* src/kz-web.[ch]: Added a new widget which has a KzEmbed as its chid widget.

Modified: kazehakase/trunk/module/embed/webkit-gtk/kz-webkit-gtk.c
===================================================================
--- kazehakase/trunk/module/embed/webkit-gtk/kz-webkit-gtk.c	2009-09-04 04:00:38 UTC (rev 3832)
+++ kazehakase/trunk/module/embed/webkit-gtk/kz-webkit-gtk.c	2009-09-08 03:10:08 UTC (rev 3833)
@@ -46,7 +46,7 @@
 static GObject *constructor  (GType type,
 			      guint n_props,
 			      GObjectConstructParam *props);
-static void 	dispose      (GObject *object);
+static void 	finalize     (GObject *object);
 
 static void	    load_uri               (KzEmbed      *kzembed,
 					    const gchar  *uri);
@@ -186,13 +186,11 @@
 kz_webkit_gtk_class_init (KzWebKitGtkClass *klass)
 {
 	GObjectClass *object_class;
-	GtkWidgetClass *widget_class;
 
 	kz_webkit_gtk_parent_class = GTK_SCROLLED_WINDOW_CLASS(g_type_class_peek_parent(klass));
 	object_class = G_OBJECT_CLASS(klass);
-	widget_class = GTK_WIDGET_CLASS(klass);
 
-	object_class->dispose = dispose;
+	object_class->finalize = finalize;
 	object_class->constructor = constructor;
 
 	g_type_class_add_private(object_class, sizeof(KzWebKitGtkPrivate));
@@ -316,14 +314,13 @@
 }
 
 static void
-dispose (GObject *object)
+finalize (GObject *object)
 {
 	KzWebKitGtkPrivate *priv = KZ_WEBKIT_GTK_GET_PRIVATE(object);
 	g_free(priv->link_message);
-	priv->link_message = NULL;
 
-	if (G_OBJECT_CLASS(kz_webkit_gtk_parent_class)->dispose)
-		G_OBJECT_CLASS(kz_webkit_gtk_parent_class)->dispose(object);
+	if (G_OBJECT_CLASS(kz_webkit_gtk_parent_class)->finalize)
+		G_OBJECT_CLASS(kz_webkit_gtk_parent_class)->finalize(object);
 }
 
 GtkWidget *

Modified: kazehakase/trunk/src/actions/kz-actions.c
===================================================================
--- kazehakase/trunk/src/actions/kz-actions.c	2009-09-04 04:00:38 UTC (rev 3832)
+++ kazehakase/trunk/src/actions/kz-actions.c	2009-09-08 03:10:08 UTC (rev 3833)
@@ -299,7 +299,6 @@
 }
 
 
-#warning FIXME! we should unify act_open_selection().
 static void
 act_open_selected_text (GtkAction *action, KzWindow *kz)
 {
@@ -313,6 +312,10 @@
 
  	g_return_if_fail (KZ_IS_WINDOW((kz)));
  
+	text = kz_web_get_selection_string(web);
+	if (!text)
+		return;
+
 	regex = g_regex_new(HTTP_REGEX, 
 			    0,
 			    0, &error);
@@ -323,9 +326,6 @@
 		return;
 	}
 
-	text = kz_web_get_selection_string(web);
-	if (!text) return;
-
 	match = g_regex_match(regex, text, 0, &match_info);
 	
 	if (match)




More information about the Kazehakase-cvs mailing list
Back to archive index