From: Andy Spencer Date: Sat, 11 Feb 2012 17:34:00 +0000 (+0000) Subject: Remove idle callback for loading markers X-Git-Tag: v0.7~4 X-Git-Url: http://pileus.org/git/?p=aweather;a=commitdiff_plain;h=79e4dddff0c033c62d92bc2e189d522942196085 Remove idle callback for loading markers The normal marker constructor is now thread safe and will do the actual loading during the first draw function, which will be called from the main thread. --- diff --git a/src/plugins/radar.c b/src/plugins/radar.c index dd57984..d9b322f 100644 --- a/src/plugins/radar.c +++ b/src/plugins/radar.c @@ -283,9 +283,8 @@ void _site_on_location_changed(GritsViewer *viewer, radar_site_unload(site); } -gboolean _site_add_marker(gpointer _site) +gboolean _site_add_marker(RadarSite *site) { - RadarSite *site = _site; site->marker = grits_marker_new(site->city->name); GRITS_OBJECT(site->marker)->center = site->city->pos; GRITS_OBJECT(site->marker)->lod = EARTH_R*0.75*site->city->lod; @@ -313,7 +312,7 @@ RadarSite *radar_site_new(city_t *city, GtkWidget *pconfig, _site_on_location_changed(viewer, lat, lon, elev, site); /* Add marker */ - g_idle_add_full(G_PRIORITY_LOW, _site_add_marker, site, NULL); + _site_add_marker(site); /* Connect signals */ site->location_id = g_signal_connect(viewer, "location-changed",