Changeset 105


Ignore:
Timestamp:
Jun 9, 2009, 11:24:42 AM (5 years ago)
Author:
simon
Message:

fix a nasty segfault in the map parser

Location:
branches/client-library-split
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • branches/client-library-split/demos/tile-renderer.c

    r103 r105  
    3333  gchar *path; 
    3434 
     35  rules = memphis_rule_set_new (); 
     36  memphis_rule_set_load_from_file (rules, "rule.xml"); 
    3537  map = memphis_map_new (); 
    3638  memphis_map_load_from_file (map, "map.osm"); 
    37   rules = memphis_rule_set_new (); 
    38   memphis_rule_set_load_from_file (rules, "rule.xml"); 
    3939 
    4040  r = memphis_renderer_new_full (rules, map); 
  • branches/client-library-split/main.c

    r103 r105  
    171171 
    172172    ruleset = memphis_rule_set_new (); 
     173    memphis_rule_set_load_from_file (ruleset, opts->cfgfn); 
     174    if (ruleset->ruleset == NULL) 
     175        return(-1); 
     176 
    173177    osm = memphis_map_new (); 
    174  
    175178    memphis_map_load_from_file (osm, opts->osmfn); 
    176179    if (osm->map == NULL) 
    177         return(-1); 
    178  
    179     memphis_rule_set_load_from_file (ruleset, opts->cfgfn); 
    180     if (ruleset->ruleset == NULL) 
    181180        return(-1); 
    182181 
  • branches/client-library-split/osm05.c

    r88 r105  
    260260    int done; 
    261261    char *buf; 
     262    osmFile *osm; 
    262263    mapUserData *data = g_new(mapUserData, 1); 
    263     osmFile *osm = NULL; 
    264264    // Init vars 
     265    data->cTag = NULL; 
     266    data->cNode = NULL; 
     267    data->cWay = NULL; 
     268    data->pool = memphis_data_pool_new (); 
    265269    data->cntTag = 0; 
    266270    data->cntNd = 0; 
    267     data->pool = memphis_data_pool_new (); 
    268271    data->debug_level = debug_level; 
    269272     
     
    358361 
    359362    g_hash_table_destroy(osm->nodeidx); 
    360     osm->nodeidx=NULL; 
     363    osm->nodeidx = NULL; 
    361364     
    362365    if (debug_level > 0) 
Note: See TracChangeset for help on using the changeset viewer.