From: Andrea Zagli Date: Sat, 13 Feb 2010 09:11:55 +0000 (+0100) Subject: Added aute_finalize. X-Git-Tag: 0.0.2~6 X-Git-Url: https://saetta.ns0.it/gitweb?a=commitdiff_plain;h=3a530869a6e7d06b10950951f45e4bb5cddc3306;p=zakauthe%2Flibzakauthe Added aute_finalize. --- diff --git a/src/aute.c b/src/aute.c index 7409925..6b7322e 100644 --- a/src/aute.c +++ b/src/aute.c @@ -35,6 +35,7 @@ static void aute_get_property (GObject *object, guint property_id, GValue *value, GParamSpec *pspec); +static void aute_finalize (GObject *object); GModule *aute_get_module_from_confi (Aute *aute); @@ -61,6 +62,7 @@ aute_class_init (AuteClass *class) object_class->set_property = aute_set_property; object_class->get_property = aute_get_property; + object_class->finalize = aute_finalize; g_type_class_add_private (object_class, sizeof (AutePrivate)); } @@ -175,12 +177,6 @@ gchar /* calling plugin's function */ ret = (*autentica) (priv->parameters); - /* closing the library */ - if (!g_module_close (priv->module)) - { - g_fprintf (stderr, "Error g_module_close\n"); - } - return ret; } @@ -221,6 +217,30 @@ aute_get_property (GObject *object, } } +static void +aute_finalize (GObject *object) +{ + Aute *aute = AUTE (object); + + AutePrivate *priv = AUTE_GET_PRIVATE (aute); + + /* closing the library */ + if (priv->module != NULL) + { + if (!g_module_close (priv->module)) + { + g_fprintf (stderr, "Error g_module_close\n"); + } + else + { + priv->module = NULL; + } + } + + /* Chain up to the parent class */ + G_OBJECT_CLASS (aute_parent_class)->finalize (object); +} + #ifdef HAVE_LIBCONFI /** * aute_get_plugin_module: