[gnome-initial-setup] Don't needlessly ref/unref in apply



commit fa2ee0a7f30a42ccaf2fa52ab231dd582c51dcc9
Author: Jasper St. Pierre <jstpierre mecheye net>
Date:   Tue Nov 5 22:00:43 2013 -0500

    Don't needlessly ref/unref in apply

 gnome-initial-setup/gis-assistant.c |    5 +----
 gnome-initial-setup/gis-page.c      |    6 ------
 2 files changed, 1 insertions(+), 10 deletions(-)
---
diff --git a/gnome-initial-setup/gis-assistant.c b/gnome-initial-setup/gis-assistant.c
index 827f904..cabcd24 100644
--- a/gnome-initial-setup/gis-assistant.c
+++ b/gnome-initial-setup/gis-assistant.c
@@ -119,8 +119,6 @@ on_apply_done (GisPage *page,
 
   if (valid)
     switch_to_next_page (assistant);
-
-  g_object_unref (assistant);
 }
 
 void
@@ -128,8 +126,7 @@ gis_assistant_next_page (GisAssistant *assistant)
 {
   GisAssistantPrivate *priv = gis_assistant_get_instance_private (assistant);
   if (priv->current_page)
-    gis_page_apply_begin (priv->current_page, on_apply_done,
-                          g_object_ref (assistant));
+    gis_page_apply_begin (priv->current_page, on_apply_done, assistant);
   else
     switch_to_next_page (assistant);
 }
diff --git a/gnome-initial-setup/gis-page.c b/gnome-initial-setup/gis-page.c
index 537a22f..ff7a107 100644
--- a/gnome-initial-setup/gis-page.c
+++ b/gnome-initial-setup/gis-page.c
@@ -297,9 +297,6 @@ gis_page_apply_begin (GisPage                *page,
 
   klass = GIS_PAGE_GET_CLASS (page);
 
-  /* Unrefs in gis_page_apply_complete() */
-  g_object_ref (page);
-
   priv->apply_cb = callback;
   priv->apply_data = user_data;
   priv->apply_cancel = g_cancellable_new ();
@@ -336,9 +333,6 @@ gis_page_apply_complete (GisPage *page,
 
   if (callback)
     (callback) (page, valid, user_data);
-
-  /* Matches ref in gis_page_apply_begin() */
-  g_object_unref (page);
 }
 
 gboolean


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