Bug 763361 - shutdown. sigsegv during freelibrary.

Call RecordShutdownEndTimeStamp from XRE_main. r=benjamin.
This commit is contained in:
Rafael Ávila de Espíndola 2012-07-06 18:29:53 -04:00
Родитель 6edfe17c80
Коммит 9119d7eaa9
3 изменённых файлов: 8 добавлений и 14 удалений

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

@ -38,6 +38,8 @@ NS_VISIBILITY_DEFAULT __attribute__((weak));
namespace mozilla {
void RecordShutdownEndTimeStamp();
class StartupTimeline {
public:
enum Event {

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

@ -285,7 +285,8 @@ RecordShutdownStartTimeStamp() {
gRecordedShutdownTimeFileName = PL_strdup(nativePath.get());
}
static void
namespace mozilla {
void
RecordShutdownEndTimeStamp() {
if (!gRecordedShutdownTimeFileName)
return;
@ -313,18 +314,7 @@ RecordShutdownEndTimeStamp() {
}
PR_Rename(tmpName.get(), name.get());
}
// For now firefox runs static destructors during shutdown on release builds
// too, so we just use one to run RecordShutdownEndTimeStamp. Once we are
// exiting earlier in release builds we just move the call.
class RecordShutdownEndTimeStampHelper {
public:
~RecordShutdownEndTimeStampHelper() {
RecordShutdownEndTimeStamp();
}
};
static RecordShutdownEndTimeStampHelper gHelper;
}
NS_IMETHODIMP
nsAppStartup::Quit(uint32_t aMode)

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

@ -3937,7 +3937,9 @@ int
XRE_main(int argc, char* argv[], const nsXREAppData* aAppData, PRUint32 aFlags)
{
XREMain main;
return main.XRE_main(argc, argv, aAppData);
int result = main.XRE_main(argc, argv, aAppData);
mozilla::RecordShutdownEndTimeStamp();
return result;
}
nsresult