[Change] Reduced calls to xmlCleanupParser(), only one for all the loading now.
This commit is contained in:
parent
843c9f138f
commit
3ddc034344
@ -152,7 +152,6 @@ int commodity_load(void) {
|
|||||||
|
|
||||||
xmlFreeDoc(doc);
|
xmlFreeDoc(doc);
|
||||||
free(buf);
|
free(buf);
|
||||||
xmlCleanupParser();
|
|
||||||
|
|
||||||
DEBUG("Loaded %d commodit%s",
|
DEBUG("Loaded %d commodit%s",
|
||||||
commodity_nstack, (commodity_nstack==1) ? "y" : "ies");
|
commodity_nstack, (commodity_nstack==1) ? "y" : "ies");
|
||||||
|
@ -562,7 +562,6 @@ int factions_load(void) {
|
|||||||
|
|
||||||
xmlFreeDoc(doc);
|
xmlFreeDoc(doc);
|
||||||
free(buf);
|
free(buf);
|
||||||
xmlCleanupParser();
|
|
||||||
|
|
||||||
DEBUG("Loaded %d Faction%s", faction_nstack, (faction_nstack==1) ?"": "s");
|
DEBUG("Loaded %d Faction%s", faction_nstack, (faction_nstack==1) ?"": "s");
|
||||||
|
|
||||||
|
@ -319,6 +319,7 @@ void load_all(void) {
|
|||||||
ships_load();
|
ships_load();
|
||||||
fleet_load();
|
fleet_load();
|
||||||
space_load();
|
space_load();
|
||||||
|
xmlCleanupParser(); /* Only needed to be run after all the loading is done. */
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -553,7 +554,6 @@ static void data_name(void) {
|
|||||||
|
|
||||||
xmlFreeDoc(doc);
|
xmlFreeDoc(doc);
|
||||||
free(buf);
|
free(buf);
|
||||||
xmlCleanupParser();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -538,7 +538,6 @@ int missions_load(void) {
|
|||||||
|
|
||||||
xmlFreeDoc(doc);
|
xmlFreeDoc(doc);
|
||||||
free(buf);
|
free(buf);
|
||||||
xmlCleanupParser();
|
|
||||||
|
|
||||||
DEBUG("Loaded %d Mission%s", mission_nstack, (mission_nstack==1) ? "" : "s");
|
DEBUG("Loaded %d Mission%s", mission_nstack, (mission_nstack==1) ? "" : "s");
|
||||||
|
|
||||||
|
@ -890,7 +890,6 @@ int outfit_load(void) {
|
|||||||
|
|
||||||
xmlFreeDoc(doc);
|
xmlFreeDoc(doc);
|
||||||
free(buf);
|
free(buf);
|
||||||
xmlCleanupParser();
|
|
||||||
|
|
||||||
DEBUG("Loaded %d outfit%s", outfit_nstack, (outfit_nstack==1) ? "" : "s");
|
DEBUG("Loaded %d outfit%s", outfit_nstack, (outfit_nstack==1) ? "" : "s");
|
||||||
|
|
||||||
|
@ -1604,7 +1604,6 @@ int fleet_load(void) {
|
|||||||
|
|
||||||
xmlFreeDoc(doc);
|
xmlFreeDoc(doc);
|
||||||
free(buf);
|
free(buf);
|
||||||
xmlCleanupParser();
|
|
||||||
|
|
||||||
DEBUG("Loaded %d fleet%s", nfleets, (nfleets==1) ? "" : "s");
|
DEBUG("Loaded %d fleet%s", nfleets, (nfleets==1) ? "" : "s");
|
||||||
|
|
||||||
|
@ -337,7 +337,6 @@ static void player_newMake(void) {
|
|||||||
|
|
||||||
xmlFreeDoc(doc);
|
xmlFreeDoc(doc);
|
||||||
free(buf);
|
free(buf);
|
||||||
xmlCleanupParser();
|
|
||||||
|
|
||||||
/* Money. */
|
/* Money. */
|
||||||
player_credits = RNG(l, h);
|
player_credits = RNG(l, h);
|
||||||
@ -1259,7 +1258,6 @@ int gui_load(const char* name) {
|
|||||||
|
|
||||||
xmlFreeDoc(doc);
|
xmlFreeDoc(doc);
|
||||||
free(buf);
|
free(buf);
|
||||||
xmlCleanupParser();
|
|
||||||
|
|
||||||
if(!found) {
|
if(!found) {
|
||||||
WARN("GUI '%s' not found in '"GUI_DATA"'",name);
|
WARN("GUI '%s' not found in '"GUI_DATA"'",name);
|
||||||
|
@ -223,6 +223,7 @@ static int load_game(char* file) {
|
|||||||
hooks_run("enter");
|
hooks_run("enter");
|
||||||
|
|
||||||
xmlFreeDoc(doc);
|
xmlFreeDoc(doc);
|
||||||
|
xmlCleanupParser();
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
@ -363,7 +363,6 @@ int ships_load(void) {
|
|||||||
|
|
||||||
xmlFreeDoc(doc);
|
xmlFreeDoc(doc);
|
||||||
free(buf);
|
free(buf);
|
||||||
xmlCleanupParser();
|
|
||||||
|
|
||||||
DEBUG("Loaded %d ship%s", ship_nstack, (ship_nstack==1) ? "" : "s");
|
DEBUG("Loaded %d ship%s", ship_nstack, (ship_nstack==1) ? "" : "s");
|
||||||
|
|
||||||
|
@ -594,7 +594,6 @@ static int planets_load(void) {
|
|||||||
|
|
||||||
xmlFreeDoc(doc);
|
xmlFreeDoc(doc);
|
||||||
free(buf);
|
free(buf);
|
||||||
xmlCleanupParser();
|
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
@ -1107,7 +1106,6 @@ static int systems_load(void) {
|
|||||||
/* Cleanup. */
|
/* Cleanup. */
|
||||||
xmlFreeDoc(doc);
|
xmlFreeDoc(doc);
|
||||||
free(buf);
|
free(buf);
|
||||||
xmlCleanupParser();
|
|
||||||
|
|
||||||
DEBUG("Loaded %d star system%s with %d planet%s",
|
DEBUG("Loaded %d star system%s with %d planet%s",
|
||||||
systems_nstack, (systems_nstack==1) ? "" : "s",
|
systems_nstack, (systems_nstack==1) ? "" : "s",
|
||||||
|
Loading…
Reference in New Issue
Block a user