[Gurlchecker-commits] r747 - in trunk: . src

esaracco at users.labs.libre-entreprise.org esaracco at users.labs.libre-entreprise.org
Tue Jan 26 22:27:33 CET 2010


Author: esaracco
Date: 2010-01-26 21:27:33 +0000 (Tue, 26 Jan 2010)
New Revision: 747

Modified:
   trunk/ChangeLog
   trunk/configure.in
   trunk/src/application.c
   trunk/src/bookmarks.c
   trunk/src/check.c
   trunk/src/html_parser.c
   trunk/src/html_parser.h
   trunk/src/lists.c
   trunk/src/lists.h
   trunk/src/project.c
   trunk/src/timeout.c
   trunk/src/web_site.c
Log:
Memory leaks fixes.


Modified: trunk/ChangeLog
===================================================================
--- trunk/ChangeLog	2010-01-26 19:11:32 UTC (rev 746)
+++ trunk/ChangeLog	2010-01-26 21:27:33 UTC (rev 747)
@@ -11,6 +11,7 @@
 	* Other:
 
 	  - Some fixes on signal connections.
+	  - Memory leaks fixes.
 	  - Code cleaning.
 
 2010-01-25 Emmanuel Saracco <esaracco at users.labs.libre-entreprise.org>

Modified: trunk/configure.in
===================================================================
--- trunk/configure.in	2010-01-26 19:11:32 UTC (rev 746)
+++ trunk/configure.in	2010-01-26 21:27:33 UTC (rev 747)
@@ -2,7 +2,7 @@
 AC_PREREQ(2.54)
 
 AC_INIT(configure.in)
-AM_INIT_AUTOMAKE(gurlchecker, 0.11.2svn2010012601)
+AM_INIT_AUTOMAKE(gurlchecker, 0.11.2svn2010012602)
 AM_CONFIG_HEADER(config.h)
 AC_CONFIG_MACRO_DIR([m4])
 

Modified: trunk/src/application.c
===================================================================
--- trunk/src/application.c	2010-01-26 19:11:32 UTC (rev 746)
+++ trunk/src/application.c	2010-01-26 21:27:33 UTC (rev 747)
@@ -34,6 +34,7 @@
 #include "ucclam.h"
 #include "uctidy.h"
 #include "uccroco.h"
+#include "cookies.h"
 
 #include "application.h"
 
@@ -1441,15 +1442,16 @@
 {
   gchar *final_path = NULL;
 
-  final_path =
-    g_strconcat (uc_project_get_working_path (), "/",
-		 uc_project_get_cache_name (), NULL);
 
+  final_path = g_strconcat (uc_project_get_working_path (), "/",
+                            uc_project_get_cache_name (), NULL);
+
   uc_utils_rmdirs (final_path, FALSE);
 
   g_free (final_path), final_path = NULL;
 }
 
+
 /**
  * uc_application_settings_dialog_display_filters_list:
  * @glade: the appropriate glade pointer.
@@ -2953,6 +2955,11 @@
   gtk_spin_button_set_value (GTK_SPIN_BUTTON (widget),
 			     (gdouble) uc_project_get_check_timeout ());
 
+  uc_application_display_state_message (UC_CHECK_MESSAGE_LABEL_FIRST,
+                                        _("Check in progress..."));
+  uc_application_display_state_message (UC_CHECK_MESSAGE_LABEL_SECOND, "");
+  uc_application_display_state_message (UC_CHECK_MESSAGE_LABEL_THIRD, "");
+
   gtk_widget_show_all (dialog);
 }
 
@@ -3967,8 +3974,12 @@
 void
 uc_application_clean_data (void)
 {
+  uc_application_set_status_bar (0, _("Cleaning..."));
+  UC_UPDATE_UI;
+
   uc_application_remove_paths ();
   uc_project_free ();
+  uc_cookies_free ();
   uc_search_free ();
   uc_lists_checked_links_free ();
   uc_lists_already_checked_free ();
@@ -3982,8 +3993,8 @@
     g_object_unref (treestore_filter_directories),
       treestore_filter_directories = NULL;
   if (treestore_filter_domains != NULL)
-    g_object_unref (treestore_filter_domains), treestore_filter_domains =
-      NULL;
+    g_object_unref (treestore_filter_domains),
+      treestore_filter_domains = NULL;
   if (treestore_search != NULL)
     g_object_unref (treestore_search), treestore_search = NULL;
   if (treestore != NULL)
@@ -3995,6 +4006,9 @@
     g_object_unref (w3c_alert_icon), w3c_alert_icon = NULL;
   if (empty_icon)
     g_object_unref (empty_icon), empty_icon = NULL;
+
+  uc_application_set_status_bar (0, "");
+  UC_UPDATE_UI;
 }
 
 /**

Modified: trunk/src/bookmarks.c
===================================================================
--- trunk/src/bookmarks.c	2010-01-26 19:11:32 UTC (rev 746)
+++ trunk/src/bookmarks.c	2010-01-26 21:27:33 UTC (rev 747)
@@ -237,7 +237,7 @@
 
   switch (uc_project_get_bookmarks_type ())
   {
-    /* XBEL */
+    // XBEL
     case UC_BOOKMARKS_TYPE_XBEL:
       /* !! HACK !!: don't know how to remove properly a node 
        * with libxml... any help? */
@@ -252,13 +252,13 @@
       break;
 
 #ifdef ENABLE_SQLITE3
-    /* FF sqlite3 */
+    // FF sqlite3
     case UC_BOOKMARKS_TYPE_FF_SQLITE3:
       uc_bookmarks_ff_sqlite3_delete_item (prop->bookmark_id);
       break;
 #endif
 
-    /* Default */
+    // Default
     case UC_BOOKMARKS_TYPE_NONE:
     default:
       g_assert_not_reached ();
@@ -284,15 +284,27 @@
 static void
 uc_bookmarks_sqlite3_close (void)
 {
-  sqlite3_close (sqlite3_cnx);
+  if (sqlite3_cnx != NULL)
+  {
+    sqlite3_close (sqlite3_cnx);
+    sqlite3_cnx = NULL;
+  }
 }
 
 
 static gint
 uc_bookmarks_sqlite3_open (const gchar *file)
 {
-  return sqlite3_open_v2 ((file)?file:uc_project_get_bookmarks_file (),
-                          &sqlite3_cnx, SQLITE_OPEN_READWRITE, NULL);
+  gint ret = -1;
+
+ 
+  if (sqlite3_cnx != NULL)
+    ret = SQLITE_OK;
+  else
+    ret = sqlite3_open_v2 ((file)?file:uc_project_get_bookmarks_file (),
+                           &sqlite3_cnx, SQLITE_OPEN_READWRITE, NULL);
+
+  return ret;
 }
 
 
@@ -433,7 +445,7 @@
                          uc_check_register_link (prop->url, prop));
       }
       else
-        uc_lists_checked_links_node_free (NULL, prop);
+        uc_lists_checked_links_node_free (NULL, &prop);
     }
   }
 
@@ -533,6 +545,8 @@
 
   uc_application_draw_main_frames ();
   uc_application_progress_dialog_show ();
+  uc_application_display_state_message (UC_CHECK_MESSAGE_LABEL_FIRST,
+                                        _("Check in progress..."));
   UC_UPDATE_UI;
 
   UC_GET_WIDGET ("urls_list", WGET ("main_window"), widget);
@@ -734,7 +748,7 @@
 				   uc_check_register_link (prop->url, prop));
 		}
 	      else
-		uc_lists_checked_links_node_free (NULL, prop);
+		uc_lists_checked_links_node_free (NULL, &prop);
 	    }
 
 	  xmlFree (key), key = NULL;

Modified: trunk/src/check.c
===================================================================
--- trunk/src/check.c	2010-01-26 19:11:32 UTC (rev 746)
+++ trunk/src/check.c	2010-01-26 21:27:33 UTC (rev 747)
@@ -1511,6 +1511,7 @@
   uc_check_ignore_item_value = value;
 }
 
+
 /*
  * reset all items in the right frames
  */
@@ -1519,6 +1520,7 @@
 {
   GtkWidget *w = NULL;
 
+
   w = WGET ("mw_label_informations_message");
   if (w != NULL)
     gtk_label_set_text (GTK_LABEL (w), "");
@@ -1538,6 +1540,7 @@
   uc_check_report_reset (-1);
 }
 
+
 /*
  * this function must be called before
  * any check, to initialize some elements
@@ -1547,11 +1550,15 @@
 {
   gchar *title = NULL;
 
+
+  uc_application_set_status_bar (0, _("Cleaning..."));
+  UC_UPDATE_UI;
+
   if (treestore != NULL)
-    {
-      g_object_unref (G_OBJECT (treestore)), treestore = NULL;
-      treeview = NULL;
-    }
+  {
+    g_object_unref (G_OBJECT (treestore)), treestore = NULL;
+    treeview = NULL;
+  }
 
   uc_lists_refresh_preserved_links_reset ();
   uc_timeout_domains_free ();
@@ -1575,8 +1582,12 @@
   title = g_strconcat ("gURLChecker ", UC_VERSION, NULL);
   gtk_window_set_title (GTK_WINDOW (WGET ("main_window")), title);
   g_free (title), title = NULL;
+
+  uc_application_set_status_bar (0, "");
+  UC_UPDATE_UI;
 }
 
+
 /*
  * return TRUE if the given content-type is parsable
  * (if it could contain links)
@@ -1926,7 +1937,7 @@
 	    uc_utils_debug ("[SECURITY] Bad extension : %s\n", (tmp)?tmp:"");
 	  }
 
-	(GList *) uc_lists_checked_links_node_free (NULL, prop_tmp);
+        uc_lists_checked_links_node_free (NULL, &prop_tmp);
       }
     }
 
@@ -2608,7 +2619,7 @@
             uc_check_currentitem_init (currentItem.parent, current_host,
                                        tag, normalized_url);
 
-            uc_lists_checked_links_node_free (NULL, prop), prop = NULL;
+            uc_lists_checked_links_node_free (NULL, &prop);
 
             // Take URL args in account when following HTTP new location or
             // META refresh value
@@ -2694,8 +2705,7 @@
       if (uc_application_auth_dialog_show
 	  (g_hash_table_lookup (prop->header, UC_WWW_AUTHENTICATE)))
 	{
-	  (GList *) uc_lists_checked_links_node_free (NULL, (gpointer) prop),
-	    prop = NULL;
+	  uc_lists_checked_links_node_free (NULL, &prop);
 	  prop = uc_check_link_get_properties (depth, current_host,
 					       current_path, tag,
 					       old_prop, accept, retry);
@@ -2710,8 +2720,7 @@
 error_handler:
 
   if (prop != NULL)
-    (GList *) uc_lists_checked_links_node_free (NULL, (gpointer) prop),
-      prop = NULL;
+    uc_lists_checked_links_node_free (NULL, &prop);
 
   return NULL;
 }

Modified: trunk/src/html_parser.c
===================================================================
--- trunk/src/html_parser.c	2010-01-26 19:11:32 UTC (rev 746)
+++ trunk/src/html_parser.c	2010-01-26 21:27:33 UTC (rev 747)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2002-2006
+ * Copyright (C) 2002-2010
  * Emmanuel Saracco <esaracco at users.labs.libre-entreprise.org>
  *
  * This program is free software; you can redistribute it and/or modify
@@ -636,10 +636,10 @@
 }
 
 void
-uc_html_parser_node_free (UCHTMLTag * tag)
+uc_html_parser_node_free (UCHTMLTag **tag)
 {
-  g_free (tag->label), tag->label = NULL;
-  g_free (tag->value), tag->value = NULL;
+  g_free ((*tag)->label), (*tag)->label = NULL;
+  g_free ((*tag)->value), (*tag)->value = NULL;
 
-  g_free (tag), tag = NULL;
+  g_free ((*tag)), (*tag) = NULL;
 }

Modified: trunk/src/html_parser.h
===================================================================
--- trunk/src/html_parser.h	2010-01-26 19:11:32 UTC (rev 746)
+++ trunk/src/html_parser.h	2010-01-26 21:27:33 UTC (rev 747)
@@ -23,7 +23,7 @@
 
 #include "general.h"
 
-void uc_html_parser_node_free (UCHTMLTag * tag);
+void uc_html_parser_node_free (UCHTMLTag **tag);
 GList *uc_html_parser_get_tags (gchar * buffer_orig);
 UCHTMLTag *uc_html_parser_node_new (void);
 GList *uc_css_parser_get_tags (gchar * buffer_orig);

Modified: trunk/src/lists.c
===================================================================
--- trunk/src/lists.c	2010-01-26 19:11:32 UTC (rev 746)
+++ trunk/src/lists.c	2010-01-26 21:27:33 UTC (rev 747)
@@ -25,6 +25,7 @@
 
 #include "lists.h"
 
+
 /*
  * struct used for the uc_lists_already_checked_links_list
  * list
@@ -46,19 +47,15 @@
  * a update */
 static GList *uc_lists_refresh_preserved_links_list = NULL;
 
-static GList *uc_lists_checked_links_free_real (GList * list);
-static UCAlreadyChecked *uc_lists_already_checked_links_node_new (const
-								  gchar *
-								  url,
-								  gpointer
-								  ac_p);
-static UCLinkProperties *uc_lists_checked_links_lookup_by_uid_real (GList *
-								    list,
-								    const
-								    guint
-								    uid);
-static GList *uc_lists_html_tags_node_free (GList * list, UCHTMLTag * tag);
+static void uc_lists_checked_links_free_real (GList **list);
+static UCAlreadyChecked *uc_lists_already_checked_links_node_new (
+  const gchar *url, gpointer ac_p);
+static UCLinkProperties *uc_lists_checked_links_lookup_by_uid_real (
+  GList *list, const guint uid);
+static void uc_lists_html_tags_node_free (GList **list, UCHTMLTag **tag);
+static void uc_lists_html_tags_free (GList ** list);
 
+
 void
 uc_lists_refresh_preserved_links_reset (void)
 {
@@ -83,38 +80,37 @@
 /*
  * free a html tags list node
  */
-static GList *
-uc_lists_html_tags_node_free (GList * list, UCHTMLTag * tag)
+static void
+uc_lists_html_tags_node_free (GList **list, UCHTMLTag **tag)
 {
-  list = g_list_remove (list, (gpointer) tag);
-  uc_html_parser_node_free (tag), tag = NULL;
-
-  return list;
+  *list = g_list_remove (*list, tag);
+  uc_html_parser_node_free (tag);
 }
 
+
 /*
  * free a html tags list
  */
-void
-uc_lists_html_tags_free (GList * list)
+static void
+uc_lists_html_tags_free (GList ** list)
 {
   GList *item = NULL;
 
-  g_return_if_fail (list != NULL);
 
-  item = g_list_first (list);
+  g_return_if_fail (*list != NULL);
+
+  item = g_list_first (*list);
   while (item != NULL)
-    {
-      UCHTMLTag *tag = (UCHTMLTag *) item->data;
+  {
+    UCHTMLTag *tag = (UCHTMLTag *) item->data;
+    item = g_list_next (item);
+    uc_lists_html_tags_node_free (list, &tag);
+  }
 
-      item = g_list_next (item);
-
-      list = uc_lists_html_tags_node_free (list, tag);
-    }
-
-  g_list_free (list), list = NULL;
+  g_list_free (*list), *list = NULL;
 }
 
+
 /*
  * append a item to the uc_lists_already_checked_links_list
  * list
@@ -153,108 +149,97 @@
 void
 uc_lists_checked_links_free (void)
 {
-  uc_lists_checked_links_list =
-    uc_lists_checked_links_free_real (uc_lists_checked_links_list),
-    uc_lists_checked_links_list = NULL;
+  uc_lists_checked_links_free_real (&uc_lists_checked_links_list);
 }
 
-void
-uc_lists_checked_links_free2 (GList *list)
-{
-  uc_lists_checked_links_free_real (list), list = NULL;
-}
 
-
 /*
  * free a UCLinkProperties node
  */
-GList *
-uc_lists_checked_links_node_free (GList * list, UCLinkProperties * prop)
+void
+uc_lists_checked_links_node_free (GList ** list, UCLinkProperties ** prop)
 {
-  if (prop == NULL)
-    return list;
+  if (*prop == NULL)
+    return;
 
-  g_free (prop->treeview_path), prop->treeview_path = NULL;
-  if (prop->link_icon != NULL)
-    g_object_unref (prop->link_icon), prop->link_icon = NULL;
-  g_free (prop->user_action), prop->user_action = NULL;
-  g_free (prop->link_value), prop->link_value = NULL;
-  g_free (prop->label), prop->label = NULL;
-  g_free (prop->url), prop->url = NULL;
-  g_free (prop->normalized_url), prop->normalized_url = NULL;
-  g_free (prop->protocol), prop->protocol = NULL;
-  g_free (prop->h_name), prop->h_name = NULL;
-  g_free (prop->port), prop->port = NULL;
-  g_free (prop->path), prop->path = NULL;
-  g_free (prop->domain), prop->domain = NULL;
-  g_free (prop->args), prop->args = NULL;
-  g_free (prop->current_path), prop->current_path = NULL;
-  g_free (prop->virname), prop->virname = NULL;
+  g_free ((*prop)->treeview_path), (*prop)->treeview_path = NULL;
+  if ((*prop)->link_icon != NULL)
+    g_object_unref ((*prop)->link_icon), (*prop)->link_icon = NULL;
+  g_free ((*prop)->user_action), (*prop)->user_action = NULL;
+  g_free ((*prop)->link_value), (*prop)->link_value = NULL;
+  g_free ((*prop)->label), (*prop)->label = NULL;
+  g_free ((*prop)->url), (*prop)->url = NULL;
+  g_free ((*prop)->normalized_url), (*prop)->normalized_url = NULL;
+  g_free ((*prop)->protocol), (*prop)->protocol = NULL;
+  g_free ((*prop)->h_name), (*prop)->h_name = NULL;
+  g_free ((*prop)->port), (*prop)->port = NULL;
+  g_free ((*prop)->path), (*prop)->path = NULL;
+  g_free ((*prop)->domain), (*prop)->domain = NULL;
+  g_free ((*prop)->args), (*prop)->args = NULL;
+  g_free ((*prop)->current_path), (*prop)->current_path = NULL;
+  g_free ((*prop)->virname), (*prop)->virname = NULL;
 
-  if (prop->header != NULL)
-    g_hash_table_destroy (prop->header), prop->header = NULL;
+  if ((*prop)->header != NULL)
+    g_hash_table_destroy ((*prop)->header), (*prop)->header = NULL;
 
-  if (prop->similar_links_parents != NULL)
+  if ((*prop)->similar_links_parents != NULL)
     {
-      g_list_foreach (prop->similar_links_parents, (GFunc) g_free, NULL);
-      g_list_free (prop->similar_links_parents),
-	prop->similar_links_parents = NULL;
+      g_list_foreach ((*prop)->similar_links_parents, (GFunc) g_free, NULL);
+      g_list_free ((*prop)->similar_links_parents),
+	(*prop)->similar_links_parents = NULL;
     }
 
-  if (prop->bad_extensions != NULL)
+  if ((*prop)->bad_extensions != NULL)
     {
-      g_list_foreach (prop->bad_extensions, (GFunc) g_free, NULL);
-      g_list_free (prop->bad_extensions), prop->bad_extensions = NULL;
+      g_list_foreach ((*prop)->bad_extensions, (GFunc) g_free, NULL);
+      g_list_free ((*prop)->bad_extensions), (*prop)->bad_extensions = NULL;
     }
 
-  /* prop->all_links (ptr on prop->tags items) */
-  g_list_free (prop->all_links), prop->all_links = NULL;
-  /* prop->emails (ptr on prop->tags items) */
-  g_list_free (prop->emails), prop->emails = NULL;
-  /* prop->metas ((ptr on prop->tags items) */
-  g_list_free (prop->metas), prop->metas = NULL;
+  /* (*prop)->all_links (ptr on (*prop)->tags items) */
+  g_list_free ((*prop)->all_links), (*prop)->all_links = NULL;
+  /* (*prop)->emails (ptr on (*prop)->tags items) */
+  g_list_free ((*prop)->emails), (*prop)->emails = NULL;
+  /* (*prop)->metas ((ptr on (*prop)->tags items) */
+  g_list_free ((*prop)->metas), (*prop)->metas = NULL;
 
-  if (prop->tags != NULL)
-    uc_lists_html_tags_free (prop->tags), prop->tags = NULL;;
+  if ((*prop)->tags != NULL)
+    uc_lists_html_tags_free (&(*prop)->tags);
 
-  if (prop->childs != NULL)
-    prop->childs = uc_lists_checked_links_free_real (prop->childs);
+  if ((*prop)->childs != NULL)
+    uc_lists_checked_links_free_real (&(*prop)->childs);
 
   if (list != NULL)
-    list = g_list_remove (list, prop);
+    *list = g_list_remove (*list, prop);
 
-  g_free (prop), prop = NULL;
-
-  return list;
+  g_free (*prop), *prop = NULL;
 }
 
+
 /*
  * free all the allocated objects of the
  * url properties list
  */
-static GList *
-uc_lists_checked_links_free_real (GList * list)
+static void
+uc_lists_checked_links_free_real (GList **list)
 {
   GList *item = NULL;
 
-  if (list == NULL)
-    return list;
 
-  item = g_list_first (list);
+  if (*list == NULL)
+    return;
+
+  item = g_list_first (*list);
   while (item != NULL)
     {
       UCLinkProperties *prop = (UCLinkProperties *) item->data;
-
       item = g_list_next (item);
-
-      list = uc_lists_checked_links_node_free (list, prop);
+      uc_lists_checked_links_node_free (list, &prop);
     }
 
-  g_list_free (list), list = NULL;
-
-  return list;
+  g_list_free (*list), *list = NULL;
 }
 
+
 /*
  * TRUE if the given url already in
  * the checked urls list
@@ -497,6 +482,7 @@
     g_list_append (prop->bad_extensions, g_strdup (url_p));
 }
 
+
 /*
  * free all allocated url strings
  */
@@ -505,6 +491,7 @@
 {
   GList *item = NULL;
 
+
   if (uc_lists_already_checked_links_list == NULL)
     return;
 
@@ -512,9 +499,7 @@
   while (item != NULL)
     {
       UCAlreadyChecked *ac = (UCAlreadyChecked *) item->data;
-
       item = g_list_next (item);
-
       g_free (ac->url), ac->url = NULL;
       g_free (ac), ac = NULL;
     }
@@ -523,6 +508,7 @@
     uc_lists_already_checked_links_list = NULL;
 }
 
+
 /*
  * allocate and fill a uc_lists_already_checked_links_list node
  */

Modified: trunk/src/lists.h
===================================================================
--- trunk/src/lists.h	2010-01-26 19:11:32 UTC (rev 746)
+++ trunk/src/lists.h	2010-01-26 21:27:33 UTC (rev 747)
@@ -38,7 +38,6 @@
 void uc_lists_already_checked_links_remove_items (UCLinkProperties * prop);
 void uc_lists_checked_links_node_replace (UCLinkProperties * old,
 					  UCLinkProperties * new);
-void uc_lists_html_tags_free (GList * list);
 gpointer uc_lists_already_checked_links_lookup (const gchar * url,
 						const gboolean return_node);
 gboolean uc_lists_already_checked_links_append (const gchar * url,
@@ -47,13 +46,11 @@
 guint32 uc_lists_checked_links_is_empty (void);
 void uc_lists_checked_links_set (GList * list);
 GList *uc_lists_checked_links_get (void);
-GList *uc_lists_checked_links_node_free (GList * list,
-					 UCLinkProperties * prop);
+void uc_lists_checked_links_node_free (GList **list, UCLinkProperties **prop);
 gpointer uc_lists_checked_links_lookup (const gchar * url);
 gboolean uc_lists_checked_links_exist (const gchar * url);
 UCLinkProperties *uc_lists_checked_links_lookup_by_uid (const guint32 uid);
 void uc_lists_checked_links_free (void);
-void uc_lists_checked_links_free2 (GList *list);
 gboolean uc_lists_similar_links_exist (GList * list, const gchar * url);
 void uc_lists_similar_links_append (gpointer prop_p, gpointer url_p);
 void uc_lists_bad_extensions_append (gpointer prop_p, gpointer url_p);

Modified: trunk/src/project.c
===================================================================
--- trunk/src/project.c	2010-01-26 19:11:32 UTC (rev 746)
+++ trunk/src/project.c	2010-01-26 21:27:33 UTC (rev 747)
@@ -141,7 +141,7 @@
 				       UCHTMLTag * main_tag, GList * tags);
 static guint uc_project_get_new_project_id (void);
 static void uc_project_projects_list_free (void);
-static void uc_project_projects_list_node_free (UCProjectProjects * pl);
+static void uc_project_projects_list_node_free (UCProjectProjects **pl);
 static UCProjectProjects *uc_project_projects_list_lookup_by_uid (const gint
 								  id);
 static GList *uc_project_xml_get_tags (const gchar * docname);
@@ -486,8 +486,12 @@
 static void
 uc_project_projects_list_delete (const gint32 id)
 {
-  uc_project_projects_list_node_free (uc_project_projects_list_lookup_by_uid
-				      (id));
+  UCProjectProjects *pl = NULL;
+
+  
+  pl = uc_project_projects_list_lookup_by_uid (id);
+  if (pl != NULL)
+    uc_project_projects_list_node_free (&pl);
 }
 
 /**
@@ -1465,17 +1469,18 @@
  * Free a projects' list node.
  */
 static void
-uc_project_projects_list_node_free (UCProjectProjects * pl)
+uc_project_projects_list_node_free (UCProjectProjects ** pl)
 {
-  g_free (pl->location), pl->location = NULL;
-  g_free (pl->title), pl->title = NULL;
-  g_free (pl->description), pl->description = NULL;
+  g_free ((*pl)->location), (*pl)->location = NULL;
+  g_free ((*pl)->title), (*pl)->title = NULL;
+  g_free ((*pl)->description), (*pl)->description = NULL;
 
-  uc_project_projects_list = g_list_remove (uc_project_projects_list, pl);
+  uc_project_projects_list = g_list_remove (uc_project_projects_list, *pl);
 
-  g_free (pl), pl = NULL;
+  g_free (*pl), *pl = NULL;
 }
 
+
 /**
  * uc_project_projects_list_free:
  *
@@ -1486,22 +1491,25 @@
 {
   GList *item = NULL;
 
+
   if (uc_project_projects_list == NULL)
     return;
 
   item = g_list_first (uc_project_get_projects_list ());
   while (item != NULL)
-    {
-      UCProjectProjects *pl = (UCProjectProjects *) item->data;
+  {
+    UCProjectProjects *pl = (UCProjectProjects *) item->data;
 
-      item = g_list_next (item);
 
-      uc_project_projects_list_node_free (pl);
-    }
+    item = g_list_next (item);
 
+    uc_project_projects_list_node_free (&pl);
+  }
+
   g_list_free (uc_project_projects_list), uc_project_projects_list = NULL;
 }
 
+
 /**
  * uc_project_projects_list_load:
  *
@@ -1588,9 +1596,6 @@
 void
 uc_project_free (void)
 {
-  uc_application_set_status_bar (0, _("Cleaning..."));
-  UC_UPDATE_UI;
-
   g_strfreev (project.reject_directories), project.reject_directories = NULL;
   g_strfreev (project.reject_domains), project.reject_domains = NULL;
 
@@ -1624,11 +1629,7 @@
   project.id = 0;
   project.local_charset = NULL;
 
-  uc_cookies_free ();
-
   uc_project_set_save_bookmarks (FALSE);
-
-  uc_application_set_status_bar (0, "");
 }
 
 /**

Modified: trunk/src/timeout.c
===================================================================
--- trunk/src/timeout.c	2010-01-26 19:11:32 UTC (rev 746)
+++ trunk/src/timeout.c	2010-01-26 21:27:33 UTC (rev 747)
@@ -78,10 +78,7 @@
   while (item != NULL)
   {
     UCTODomains *d = (UCTODomains *) item->data;
-
-
     item = g_list_next (item);
-
     g_free (d->domain), d->domain = NULL;
     g_free (d), d = NULL;
   }

Modified: trunk/src/web_site.c
===================================================================
--- trunk/src/web_site.c	2010-01-26 19:11:32 UTC (rev 746)
+++ trunk/src/web_site.c	2010-01-26 21:27:33 UTC (rev 747)
@@ -120,7 +120,7 @@
       else
       {
         if (lp != NULL)
-          uc_lists_checked_links_node_free (NULL, (gpointer) lp);
+          uc_lists_checked_links_node_free (NULL, &lp);
 
         g_free (normalized_url), normalized_url = NULL;
       }
@@ -265,15 +265,14 @@
 
   uc_application_set_status_bar (0, _("Updating link..."));
   uc_application_progress_dialog_show ();
+  uc_application_display_state_message (UC_CHECK_MESSAGE_LABEL_FIRST,
+                                        _("Check in progress..."));
   WSENS ("bt_ignore_progress_dialog", FALSE);
   WSENS ("bt_suspend_progress_dialog", FALSE);
   UC_UPDATE_UI;
 
   prop = uc_lists_checked_links_lookup_by_uid (id);
 
-  uc_application_display_state_message (UC_CHECK_MESSAGE_LABEL_FIRST,
-                                        prop->path);
-
   time (&t);
   t -= (uc_report_get_elapsedtime () + 3600);
   timer_id = g_timeout_add (1000, &uc_report_timer_callback, (gpointer) t);
@@ -363,7 +362,7 @@
       uc_check_set_depth (uc_lists_checked_links_get (), 0);
     }
   else if (new_prop != NULL)
-    (GList *) uc_lists_checked_links_node_free (NULL, new_prop);
+    uc_lists_checked_links_node_free (NULL, &new_prop);
 
   treepath = gtk_tree_path_new_from_string (prop->treeview_path);
   uc_application_main_tree_display_all ();
@@ -659,7 +658,7 @@
   else
     {
       if (new_prop != NULL)
-        uc_lists_checked_links_node_free (NULL, new_prop);
+        uc_lists_checked_links_node_free (NULL, &new_prop);
 
       g_free (normalized_url), normalized_url = NULL;
     }
@@ -689,9 +688,6 @@
   prop = uc_lists_checked_links_lookup_by_uid (id);
   g_assert (prop->childs);
 
-  uc_application_display_state_message (UC_CHECK_MESSAGE_LABEL_FIRST,
-                                        prop->path);
-
   time (&t);
   t -= (uc_report_get_elapsedtime () + 3600);
   timer_id = g_timeout_add (1000, &uc_report_timer_callback, (gpointer) t);
@@ -735,7 +731,6 @@
 
   uc_application_set_status_bar (0, _("Updating all project..."));
   uc_application_progress_dialog_show ();
-  uc_application_display_state_message (UC_CHECK_MESSAGE_LABEL_FIRST, "");
   WSENS ("bt_ignore_progress_dialog", FALSE);
   WSENS ("bt_suspend_progress_dialog", FALSE);
   UC_UPDATE_UI;



More information about the Gurlchecker-commits mailing list