]> Pileus Git - aweather/commitdiff
Remove idle callback for loading markers
authorAndy Spencer <andy753421@gmail.com>
Sat, 11 Feb 2012 17:34:00 +0000 (17:34 +0000)
committerAndy Spencer <andy753421@gmail.com>
Sun, 12 Feb 2012 07:05:42 +0000 (07:05 +0000)
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.

src/plugins/radar.c

index dd57984e9003939e22bd809366384df28e7a293a..d9b322ffbefe9804bd8338c6861f1239f5739e04 100644 (file)
@@ -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",