--- trunk/src/cache.c 2009/11/26 10:05:23 214 +++ trunk/src/cache.c 2009/11/30 21:28:04 221 @@ -83,11 +83,10 @@ /* update position labels */ int strike = notes_get_override(context)?STRIKETHROUGH:STRIKETHROUGH_NONE; - char str[32]; - pos_lat_str(str, sizeof(str), context->cache->pos.lat); - gtk_label_attrib_set(context->pos_lat_label, str, SIZE_BIG, strike); - pos_lon_str(str, sizeof(str), context->cache->pos.lon); - gtk_label_attrib_set(context->pos_lon_label, str, SIZE_BIG, strike); + lat_label_attrib_set(context->pos_lat_label, + context->cache->pos.lat, SIZE_BIG, strike); + lon_label_attrib_set(context->pos_lon_label, + context->cache->pos.lon, SIZE_BIG, strike); /* remove enire hbox and build a new one */ gtk_container_foreach(GTK_CONTAINER(context->bearing_hbox), @@ -746,6 +745,11 @@ /* striked out coordinate may need update */ overview_coordinate_update(context); } + + if(strcasecmp(name, _("Goto")) == 0) { + /* redo coo_button since state of overwritten coordinate may have changed */ + preset_coordinate_picker_update(context->appdata, context->gotoc.coo_popup); + } } static void on_notebook_destroy(GtkWidget *widget, gpointer user_data ) { @@ -767,7 +771,8 @@ gtk_timeout_remove(context->handler_id); #endif - free(user_data); + printf("freeing cache context\n"); + g_free(context); } #if defined(USE_MAEMO) && (MAEMO_VERSION_MAJOR >= 5) @@ -867,8 +872,7 @@ GtkWidget *cache_view(appdata_t *appdata, cache_t *cache) { GtkWidget *notebook; - cache_context_t *cache_context = malloc(sizeof(cache_context_t)); - memset(cache_context, 0, sizeof(cache_context_t)); + cache_context_t *cache_context = g_new0(cache_context_t, 1); cache_context->appdata = appdata; cache_context->cache = cache;