Skip to content

Commit b6c285f

Browse files
committed
issue #9932 Incomplete Style.css
In case of writing files to a network disk it is possible that the not-closed files are not completely written to disk, explicitly closing files.
1 parent 2ac024c commit b6c285f

File tree

2 files changed

+10
-0
lines changed

2 files changed

+10
-0
lines changed

src/doxygen.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9552,6 +9552,7 @@ static void generateConfigFile(const QCString &configFile,bool shortList,
95529552
{
95539553
msg("\n\nConfiguration file '%s' updated.\n\n",qPrint(configFile));
95549554
}
9555+
f.close();
95559556
}
95569557
}
95579558
else
@@ -10868,6 +10869,7 @@ void readConfiguration(int argc, char **argv)
1086810869
TextStream t(&f);
1086910870
RTFGenerator::writeExtensionsFile(t);
1087010871
}
10872+
f.close();
1087110873
cleanUpDoxygen();
1087210874
exit(0);
1087310875
}
@@ -10897,6 +10899,7 @@ void readConfiguration(int argc, char **argv)
1089710899
TextStream t(&f);
1089810900
EmojiEntityMapper::instance().writeEmojiFile(t);
1089910901
}
10902+
f.close();
1090010903
cleanUpDoxygen();
1090110904
exit(0);
1090210905
}
@@ -10932,6 +10935,7 @@ void readConfiguration(int argc, char **argv)
1093210935
cleanUpDoxygen();
1093310936
exit(1);
1093410937
}
10938+
f.close();
1093510939
cleanUpDoxygen();
1093610940
exit(0);
1093710941
}
@@ -10979,6 +10983,7 @@ void readConfiguration(int argc, char **argv)
1097910983
TextStream t(&f);
1098010984
HtmlGenerator::writeStyleSheetFile(t);
1098110985
}
10986+
f.close();
1098210987
cleanUpDoxygen();
1098310988
exit(0);
1098410989
}
@@ -11025,6 +11030,7 @@ void readConfiguration(int argc, char **argv)
1102511030
TextStream t(&f);
1102611031
LatexGenerator::writeStyleSheetFile(t);
1102711032
}
11033+
f.close();
1102811034
cleanUpDoxygen();
1102911035
exit(0);
1103011036
}

src/message.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,7 @@ static void format_warn(const QCString &file,int line,const QCString &text)
122122
}
123123
if (g_warnBehavior == WARN_AS_ERROR_t::YES)
124124
{
125+
if (g_warnFile != stderr && g_warnFile != stdout) Portable::fclose(g_warnFile);
125126
Doxygen::terminating=true;
126127
exit(1);
127128
}
@@ -137,6 +138,7 @@ static void handle_warn_as_error()
137138
QCString msgText = " (warning treated as error, aborting now)\n";
138139
fwrite(msgText.data(),1,msgText.length(),g_warnFile);
139140
}
141+
if (g_warnFile != stderr && g_warnFile != stdout) Portable::fclose(g_warnFile);
140142
Doxygen::terminating=true;
141143
exit(1);
142144
}
@@ -268,6 +270,7 @@ void term(const char *fmt, ...)
268270
fprintf(g_warnFile, "%s\n", "Exiting...");
269271
}
270272
}
273+
if (g_warnFile != stderr && g_warnFile != stdout) Portable::fclose(g_warnFile);
271274
Doxygen::terminating=true;
272275
exit(1);
273276
}
@@ -310,6 +313,7 @@ extern void finishWarnExit()
310313
if (g_warnStat && (g_warnBehavior == WARN_AS_ERROR_t::FAIL_ON_WARNINGS ||
311314
g_warnBehavior == WARN_AS_ERROR_t::FAIL_ON_WARNINGS_PRINT))
312315
{
316+
if (g_warnFile != stderr && g_warnFile != stdout) Portable::fclose(g_warnFile);
313317
Doxygen::terminating=true;
314318
exit(1);
315319
}

0 commit comments

Comments
 (0)