--- atspi/atspi-device.c | 22 ++++++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) --- a/atspi/atspi-device.c +++ b/atspi/atspi-device.c @@ -597,6 +597,24 @@ atspi_device_get_app_id (AtspiDevice *de return priv->app_id; } + +static inline gboolean +my_g_set_str (char **str_pointer, + const char *new_str) +{ + char *copy; + + if (*str_pointer == new_str || + (*str_pointer && new_str && strcmp (*str_pointer, new_str) == 0)) + return FALSE; + + copy = g_strdup (new_str); + g_free (*str_pointer); + *str_pointer = copy; + + return TRUE; +} + /** * atspi_device_set_app_id: * @device: the device. @@ -610,6 +628,6 @@ void atspi_device_set_app_id (AtspiDevice *device, const gchar *app_id) { AtspiDevicePrivate *priv = atspi_device_get_instance_private (device); - if (g_set_str (&priv->app_id, app_id)) + if (my_g_set_str (&priv->app_id, app_id)) g_object_notify_by_pspec (G_OBJECT (device), obj_props[PROP_APP_ID]); -} \ No newline at end of file +}