[eog] Remove unneeded static variable



commit d90c385f06fc57837bbfe39e7f8b6084eccaace9
Author: Felix Riemann <friemann gnome org>
Date:   Fri Sep 30 22:54:01 2011 +0200

    Remove unneeded static variable
    
    An interface's default_init function doesn't need to be secured against
    multiple calls as it actually behaves similar to a class_init function.

 src/eog-window-activatable.c |   33 ++++++++++++++-------------------
 1 files changed, 14 insertions(+), 19 deletions(-)
---
diff --git a/src/eog-window-activatable.c b/src/eog-window-activatable.c
index 3221ab7..a70f56f 100644
--- a/src/eog-window-activatable.c
+++ b/src/eog-window-activatable.c
@@ -38,25 +38,20 @@ G_DEFINE_INTERFACE(EogWindowActivatable, eog_window_activatable, G_TYPE_OBJECT)
 void
 eog_window_activatable_default_init (EogWindowActivatableInterface *iface)
 {
-	static gboolean initialized = FALSE;
-
-	if (!initialized) {
-		/**
-		 * EogWindowActivatable:window:
-		 *
-		 * This is the #EogWindow this #EogWindowActivatable instance
-		 * should be attached to.
-		 */
-		g_object_interface_install_property (iface,
-				g_param_spec_object ("window", "Window",
-						     "The EogWindow this "
-						     "instance it attached to",
-						     EOG_TYPE_WINDOW,
-						     G_PARAM_READWRITE |
-						     G_PARAM_CONSTRUCT_ONLY |
-						     G_PARAM_STATIC_STRINGS));
-		initialized = TRUE;
-	}
+	/**
+	 * EogWindowActivatable:window:
+	 *
+	 * This is the #EogWindow this #EogWindowActivatable instance
+	 * should be attached to.
+	 */
+	g_object_interface_install_property (iface,
+			g_param_spec_object ("window", "Window",
+					     "The EogWindow this "
+					     "instance it attached to",
+					     EOG_TYPE_WINDOW,
+					     G_PARAM_READWRITE |
+					     G_PARAM_CONSTRUCT_ONLY |
+					     G_PARAM_STATIC_STRINGS));
 }
 
 void



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