{
if (! this->path2 || !this->path2->path_hash)
return 0;
- return (int)item_hash_lookup(this->path2->path_hash, item);
+ return (int)(long)item_hash_lookup(this->path2->path_hash, item);
}
/**
if (!this->graph || !this->path2) {
dbg(1,"rebuild graph\n");
if (! this->route_graph_flood_done_cb)
- this->route_graph_flood_done_cb=callback_new_2(callback_cast(route_path_update_done), this, 1);
+ this->route_graph_flood_done_cb=callback_new_2(callback_cast(route_path_update_done), this, (long)1);
dbg(1,"route_graph_update\n");
route_graph_update(this, this->route_graph_flood_done_cb, async);
}
route_graph_build_done(struct route_graph *rg, int cancel)
{
dbg(1,"cancel=%d\n",cancel);
- event_remove_idle(rg->idle_ev);
- callback_destroy(rg->idle_cb);
+ if (rg->idle_ev)
+ event_remove_idle(rg->idle_ev);
+ if (rg->idle_cb)
+ callback_destroy(rg->idle_cb);
map_rect_destroy(rg->mr);
mapset_close(rg->h);
route_free_selection(rg->sel);
if (async) {
ret->idle_cb=callback_new_1(callback_cast(route_graph_build_idle), ret);
ret->idle_ev=event_add_idle(50, ret->idle_cb);
- } else {
- while (ret->busy)
- route_graph_build_idle(ret);
}
} else
route_graph_build_done(ret, 0);
route_status.u.num=route_status_building_graph;
route_set_attr(this, &route_status);
this->graph=route_graph_build(this->ms, &this->pos->c, &this->dst->c, this->route_graph_done_cb, async);
+ if (! async) {
+ while (this->graph->busy)
+ route_graph_build_idle(this->graph);
+ }
}
/**