Skip to content

Commit adf47da

Browse files
committed
Merge branch 'master' of github.com:AMDmi3/osm2go
2 parents a386ff4 + 882cc27 commit adf47da

File tree

9 files changed

+5
-24
lines changed

9 files changed

+5
-24
lines changed

src/diff.c

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -251,7 +251,6 @@ void diff_save(project_t *project, osm_t *osm) {
251251

252252
xmlSaveFormatFileEnc(diff_name, doc, "UTF-8", 1);
253253
xmlFreeDoc(doc);
254-
xmlCleanupParser();
255254

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

717716
xmlFreeDoc(doc);
718-
xmlCleanupParser();
719717

720718
/* check for hidden ways and update menu accordingly */
721719
gboolean something_is_hidden = FALSE;

src/josm_elemstyles.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -321,7 +321,6 @@ static elemstyle_t *parse_doc(xmlDocPtr doc) {
321321
}
322322

323323
xmlFreeDoc(doc);
324-
xmlCleanupParser();
325324
return elemstyles;
326325
}
327326

src/josm_presets.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -348,7 +348,6 @@ static presets_item_t *parse_doc(xmlDocPtr doc) {
348348
}
349349

350350
xmlFreeDoc(doc);
351-
xmlCleanupParser();
352351
return presets;
353352
}
354353

src/main.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1249,6 +1249,8 @@ void cleanup(appdata_t *appdata) {
12491249
osm_free(&appdata->icon, appdata->osm);
12501250
appdata->osm = NULL;
12511251

1252+
xmlCleanupParser();
1253+
12521254
curl_global_cleanup();
12531255

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

1388+
/* Same for libxml2 */
1389+
xmlInitParser();
1390+
13861391
g_thread_init(NULL);
13871392

13881393
gtk_init (&argc, &argv);

src/osm.c

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1126,8 +1126,6 @@ osm_t *osm_parse(char *path, char *filename) {
11261126
g_free(full);
11271127
}
11281128

1129-
xmlCleanupParser();
1130-
11311129
struct timeval end;
11321130
gettimeofday(&end, NULL);
11331131

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

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

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

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

14391435
return (char*)result;
14401436
}

src/project.c

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -187,7 +187,6 @@ static gboolean project_read(appdata_t *appdata,
187187
}
188188

189189
xmlFreeDoc(doc);
190-
xmlCleanupParser();
191190

192191
return TRUE;
193192
}
@@ -264,7 +263,6 @@ gboolean project_save(GtkWidget *parent, project_t *project) {
264263

265264
xmlSaveFormatFileEnc(project_file, doc, "UTF-8", 1);
266265
xmlFreeDoc(doc);
267-
xmlCleanupParser();
268266

269267
g_free(project_file);
270268

src/style.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -209,7 +209,6 @@ static style_t *parse_doc(xmlDocPtr doc) {
209209
}
210210

211211
xmlFreeDoc(doc);
212-
xmlCleanupParser();
213212
return style;
214213
}
215214

src/track.c

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -212,12 +212,6 @@ static track_t *track_parse_doc(bounds_t *bounds, xmlDocPtr doc) {
212212
/*free the document */
213213
xmlFreeDoc(doc);
214214

215-
/*
216-
* Free the global variables that may
217-
* have been allocated by the parser.
218-
*/
219-
xmlCleanupParser();
220-
221215
return track;
222216
}
223217

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

356350
xmlSaveFormatFileEnc(name, doc, "UTF-8", 1);
357351
xmlFreeDoc(doc);
358-
xmlCleanupParser();
359352

360353
track->dirty = FALSE;
361354
}

src/wms.c

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -319,12 +319,6 @@ static void wms_cap_parse_doc(wms_t *wms, xmlDocPtr doc) {
319319

320320
/*free the document */
321321
xmlFreeDoc(doc);
322-
323-
/*
324-
* Free the global variables that may
325-
* have been allocated by the parser.
326-
*/
327-
xmlCleanupParser();
328322
}
329323

330324
/* get pixel extent of image display */

0 commit comments

Comments
 (0)