X-Git-Url: http://pileus.org/git/?p=aweather;a=blobdiff_plain;f=src%2Fplugins%2Fgps-plugin.c;h=f91382d5a85989167642d7931d8978709b9e6729;hp=fe693e325423a07852e398867038557f8a32fc1f;hb=09e7e102e065b1984669c93fb4f8d324a774116b;hpb=276728b7cc42bad3ec38acfe375c3a30ae87e587 diff --git a/src/plugins/gps-plugin.c b/src/plugins/gps-plugin.c index fe693e3..f91382d 100644 --- a/src/plugins/gps-plugin.c +++ b/src/plugins/gps-plugin.c @@ -514,11 +514,7 @@ gboolean gps_redraw_all(gpointer data) gps_track_add_point(&gps->track, gps_data->fix.latitude, gps_data->fix.longitude, 0.0); - if (gps->track.line) { - grits_viewer_remove(gps->viewer, - GRITS_OBJECT(gps->track.line)); - gps->track.line = NULL; - } + grits_object_destroy_pointer(&gps->track.line); gps->track.line = grits_line_new(gps->track.points); gps->track.line->color[0] = 1.0; @@ -533,11 +529,7 @@ gboolean gps_redraw_all(gpointer data) } if (gps_data_is_valid(gps_data)) { - if (gps->marker) { - grits_viewer_remove(gps->viewer, - GRITS_OBJECT(gps->marker)); - gps->marker = NULL; - } + grits_object_destroy_pointer(&gps->marker); gchar *path = find_path(GPS_MARKER_ICON_PATH, GPS_MARKER_ICON); if (path) { @@ -949,9 +941,7 @@ static void grits_plugin_gps_dispose(GObject *gobject) if (gps->viewer) { GritsViewer *viewer = gps->viewer; gps->viewer = NULL; - if (gps->marker) - grits_viewer_remove(viewer, - GRITS_OBJECT(gps->marker)); + grits_object_destroy_pointer(&gps->marker); g_object_unref(gps->prefs); g_object_unref(viewer); }