diff --git a/src/gswe-moment.c b/src/gswe-moment.c index 7edee8b..217e93a 100644 --- a/src/gswe-moment.c +++ b/src/gswe-moment.c @@ -878,7 +878,7 @@ add_points(GswePlanetData *planet_data, GsweMoment *moment) { guint point; - gswe_moment_calculate_planet(moment, planet_data->planet, NULL); + gswe_moment_calculate_planet(moment, planet_data->planet_info->planet, NULL); point = GPOINTER_TO_INT(g_hash_table_lookup(moment->priv->element_points, GINT_TO_POINTER(planet_data->sign->element))) + planet_data->planet_info->points; g_hash_table_replace(moment->priv->element_points, GINT_TO_POINTER(planet_data->sign->element), GINT_TO_POINTER(point)); diff --git a/src/swe-glib.c b/src/swe-glib.c index 4cfe138..71e19e2 100644 --- a/src/swe-glib.c +++ b/src/swe-glib.c @@ -96,13 +96,6 @@ GsweTimestamp *gswe_full_moon_base_date; */ G_DEFINE_QUARK(gswe-error-quark, gswe_error); -void -gswe_free_planet_info(gpointer planet_info) -{ - g_free(((GswePlanetInfo *)planet_info)->name); - g_free(planet_info); -} - void gswe_free_sign_info(gpointer sign_info) { @@ -139,7 +132,7 @@ gswe_init(void) bindtextdomain(GETTEXT_PACKAGE, LOCALEDIR); bind_textdomain_codeset(GETTEXT_PACKAGE, "UTF-8"); - gswe_planet_info_table = g_hash_table_new_full(g_direct_hash, g_direct_equal, NULL, gswe_free_planet_info); + gswe_planet_info_table = g_hash_table_new_full(g_direct_hash, g_direct_equal, NULL, (GDestroyNotify)gswe_planet_info_unref); ADD_PLANET(gswe_planet_info_table, planet_info, GSWE_PLANET_SUN, SE_SUN, TRUE, _("Sun"), 13.0, 2); ADD_PLANET(gswe_planet_info_table, planet_info, GSWE_PLANET_MOON, SE_MOON, TRUE, _("Moon"), 9.0, 2);