Skip to content

Commit

Permalink
Merge branch 'master' of github.com:AMDmi3/osm2go
Browse files Browse the repository at this point in the history
  • Loading branch information
AMDmi3 committed Feb 16, 2014
2 parents a386ff4 + 882cc27 commit adf47da
Show file tree
Hide file tree
Showing 9 changed files with 5 additions and 24 deletions.
2 changes: 0 additions & 2 deletions src/diff.c
Original file line number Diff line number Diff line change
Expand Up @@ -251,7 +251,6 @@ void diff_save(project_t *project, osm_t *osm) {

xmlSaveFormatFileEnc(diff_name, doc, "UTF-8", 1);
xmlFreeDoc(doc);
xmlCleanupParser();

/* if we reach this point writing the new file worked and we */
/* can delete the backup */
Expand Down Expand Up @@ -715,7 +714,6 @@ void diff_restore(appdata_t *appdata, project_t *project, osm_t *osm) {
g_free(diff_name);

xmlFreeDoc(doc);
xmlCleanupParser();

/* check for hidden ways and update menu accordingly */
gboolean something_is_hidden = FALSE;
Expand Down
1 change: 0 additions & 1 deletion src/josm_elemstyles.c
Original file line number Diff line number Diff line change
Expand Up @@ -321,7 +321,6 @@ static elemstyle_t *parse_doc(xmlDocPtr doc) {
}

xmlFreeDoc(doc);
xmlCleanupParser();
return elemstyles;
}

Expand Down
1 change: 0 additions & 1 deletion src/josm_presets.c
Original file line number Diff line number Diff line change
Expand Up @@ -348,7 +348,6 @@ static presets_item_t *parse_doc(xmlDocPtr doc) {
}

xmlFreeDoc(doc);
xmlCleanupParser();
return presets;
}

Expand Down
5 changes: 5 additions & 0 deletions src/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -1249,6 +1249,8 @@ void cleanup(appdata_t *appdata) {
osm_free(&appdata->icon, appdata->osm);
appdata->osm = NULL;

xmlCleanupParser();

curl_global_cleanup();

josm_presets_free(appdata->presets);
Expand Down Expand Up @@ -1383,6 +1385,9 @@ int main(int argc, char *argv[]) {
/* Must initialize libcurl before any threads are started */
curl_global_init(CURL_GLOBAL_ALL);

/* Same for libxml2 */
xmlInitParser();

g_thread_init(NULL);

gtk_init (&argc, &argv);
Expand Down
4 changes: 0 additions & 4 deletions src/osm.c
Original file line number Diff line number Diff line change
Expand Up @@ -1126,8 +1126,6 @@ osm_t *osm_parse(char *path, char *filename) {
g_free(full);
}

xmlCleanupParser();

struct timeval end;
gettimeofday(&end, NULL);

Expand Down Expand Up @@ -1388,7 +1386,6 @@ static char *osm_generate_xml(osm_t *osm, item_id_t changeset,

xmlDocDumpFormatMemoryEnc(doc, &result, &len, "UTF-8", 1);
xmlFreeDoc(doc);
xmlCleanupParser();

// puts("xml encoding result:");
// puts((char*)result);
Expand Down Expand Up @@ -1434,7 +1431,6 @@ char *osm_generate_xml_changeset(osm_t *osm, char *comment) {

xmlDocDumpFormatMemoryEnc(doc, &result, &len, "UTF-8", 1);
xmlFreeDoc(doc);
xmlCleanupParser();

return (char*)result;
}
Expand Down
2 changes: 0 additions & 2 deletions src/project.c
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,6 @@ static gboolean project_read(appdata_t *appdata,
}

xmlFreeDoc(doc);
xmlCleanupParser();

return TRUE;
}
Expand Down Expand Up @@ -264,7 +263,6 @@ gboolean project_save(GtkWidget *parent, project_t *project) {

xmlSaveFormatFileEnc(project_file, doc, "UTF-8", 1);
xmlFreeDoc(doc);
xmlCleanupParser();

g_free(project_file);

Expand Down
1 change: 0 additions & 1 deletion src/style.c
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,6 @@ static style_t *parse_doc(xmlDocPtr doc) {
}

xmlFreeDoc(doc);
xmlCleanupParser();
return style;
}

Expand Down
7 changes: 0 additions & 7 deletions src/track.c
Original file line number Diff line number Diff line change
Expand Up @@ -212,12 +212,6 @@ static track_t *track_parse_doc(bounds_t *bounds, xmlDocPtr doc) {
/*free the document */
xmlFreeDoc(doc);

/*
* Free the global variables that may
* have been allocated by the parser.
*/
xmlCleanupParser();

return track;
}

Expand Down Expand Up @@ -355,7 +349,6 @@ void track_write(char *name, track_t *track) {

xmlSaveFormatFileEnc(name, doc, "UTF-8", 1);
xmlFreeDoc(doc);
xmlCleanupParser();

track->dirty = FALSE;
}
Expand Down
6 changes: 0 additions & 6 deletions src/wms.c
Original file line number Diff line number Diff line change
Expand Up @@ -319,12 +319,6 @@ static void wms_cap_parse_doc(wms_t *wms, xmlDocPtr doc) {

/*free the document */
xmlFreeDoc(doc);

/*
* Free the global variables that may
* have been allocated by the parser.
*/
xmlCleanupParser();
}

/* get pixel extent of image display */
Expand Down

0 comments on commit adf47da

Please sign in to comment.