contact->priv = priv;
- priv->location = g_hash_table_new_full (g_str_hash, g_str_equal,
- (GDestroyNotify) g_free,
- (GDestroyNotify) tp_g_value_slice_free);
+ priv->location = NULL;
}
static void
if (priv->avatar)
empathy_avatar_unref (priv->avatar);
+ if (priv->location != NULL)
+ g_hash_table_unref (priv->location);
+
G_OBJECT_CLASS (empathy_contact_parent_class)->finalize (object);
}
* Example: a "city" key would have "Helsinki" as string GValue,
* a "latitude" would have 65.0 as double GValue.
*
- * Returns: a #GHashTable of location values
+ * Returns: a #GHashTable of location values, use #g_hash_table_unref when it to free it
*/
GHashTable *
empathy_contact_get_location (EmpathyContact *contact)
priv = GET_PRIV (contact);
- g_hash_table_unref (priv->location);
+ if (priv->location != NULL)
+ g_hash_table_unref (priv->location);
priv->location = g_hash_table_ref (location);
g_object_notify (G_OBJECT (contact), "location");