Bug 559113 - Fix dangling FILE pointer in GCMETER code. r=jorendorff.

This commit is contained in:
Gregor Wagner 2010-04-16 15:54:56 -05:00
Родитель 95065267f5
Коммит 99e8d55d3d
1 изменённых файлов: 4 добавлений и 2 удалений

Просмотреть файл

@ -2843,11 +2843,11 @@ void dumpGCTimer(GCTimer *gcT, uint64 firstEnter, bool lastGC)
if (!gcFile) {
gcFile = fopen("gcTimer.dat", "w");
JS_ASSERT(gcFile);
fprintf(gcFile, " AppTime, Total, Mark, Sweep, FinObj, ");
fprintf(gcFile, "FinStr, FinDbl, Destroy, newChunks, destoyChunks\n");
}
JS_ASSERT(gcFile);
fprintf(gcFile, "%12.1f, %6.1f, %6.1f, %6.1f, %6.1f, %6.1f, %6.1f, %7.1f, ",
(double)(gcT->enter - firstEnter) / 1E6,
(double)(gcT->end-gcT->enter) / 1E6,
@ -2860,8 +2860,10 @@ void dumpGCTimer(GCTimer *gcT, uint64 firstEnter, bool lastGC)
fprintf(gcFile, "%10d, %10d \n", newChunkCount, destroyChunkCount);
fflush(gcFile);
if (lastGC)
if (lastGC) {
fclose(gcFile);
gcFile = NULL;
}
}
# define GCTIMER_PARAM , GCTimer &gcTimer