Error-reporter: don't crash on reset
Sentry-Id: FLIGHTGEAR-QFP
This commit is contained in:
parent
39f761e171
commit
19a010307d
2 changed files with 17 additions and 5 deletions
src/Main
|
@ -768,8 +768,10 @@ void ErrorReporter::init()
|
||||||
SG_LOG(SG_GENERAL, SG_INFO, "Error reporting disabled");
|
SG_LOG(SG_GENERAL, SG_INFO, "Error reporting disabled");
|
||||||
simgear::setFailureCallback(simgear::FailureCallback());
|
simgear::setFailureCallback(simgear::FailureCallback());
|
||||||
simgear::setErrorContextCallback(simgear::ContextCallback());
|
simgear::setErrorContextCallback(simgear::ContextCallback());
|
||||||
sglog().removeCallback(d->_logCallback.get());
|
if (d->_logCallbackRegistered) {
|
||||||
d->_logCallbackRegistered = false;
|
sglog().removeCallback(d->_logCallback.get());
|
||||||
|
d->_logCallbackRegistered = false;
|
||||||
|
}
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -885,8 +887,14 @@ void ErrorReporter::shutdown()
|
||||||
globals->get_commands()->removeCommand("dismiss-error-report");
|
globals->get_commands()->removeCommand("dismiss-error-report");
|
||||||
globals->get_commands()->removeCommand("save-error-report-data");
|
globals->get_commands()->removeCommand("save-error-report-data");
|
||||||
globals->get_commands()->removeCommand("show-error-report");
|
globals->get_commands()->removeCommand("show-error-report");
|
||||||
sglog().removeCallback(d->_logCallback.get());
|
|
||||||
d->_logCallbackRegistered = false;
|
// during a reset we don't want to touch the log callback; it was added in
|
||||||
|
// preinit, which does not get repeated on a reset
|
||||||
|
const bool inReset = fgGetBool("/sim/signals/reinit", false);
|
||||||
|
if (!inReset) {
|
||||||
|
sglog().removeCallback(d->_logCallback.get());
|
||||||
|
d->_logCallbackRegistered = false;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -155,6 +155,7 @@
|
||||||
#include "util.hxx"
|
#include "util.hxx"
|
||||||
#include "AircraftDirVisitorBase.hxx"
|
#include "AircraftDirVisitorBase.hxx"
|
||||||
#include <Main/sentryIntegration.hxx>
|
#include <Main/sentryIntegration.hxx>
|
||||||
|
#include <Main/ErrorReporter.hxx>
|
||||||
|
|
||||||
#if defined(SG_MAC)
|
#if defined(SG_MAC)
|
||||||
#include <GUI/CocoaHelpers.h> // for Mac impl of platformDefaultDataPath()
|
#include <GUI/CocoaHelpers.h> // for Mac impl of platformDefaultDataPath()
|
||||||
|
@ -1235,7 +1236,10 @@ void fgStartNewReset()
|
||||||
SGSubsystemGroup* grp = subsystemManger->get_group(static_cast<SGSubsystemMgr::GroupType>(g));
|
SGSubsystemGroup* grp = subsystemManger->get_group(static_cast<SGSubsystemMgr::GroupType>(g));
|
||||||
for (auto nm : grp->member_names()) {
|
for (auto nm : grp->member_names()) {
|
||||||
if ((nm == "time") || (nm == "terrasync") || (nm == "events")
|
if ((nm == "time") || (nm == "terrasync") || (nm == "events")
|
||||||
|| (nm == "lighting") || (nm == FGScenery::staticSubsystemClassId()))
|
|| (nm == "lighting")
|
||||||
|
|| (nm == FGScenery::staticSubsystemClassId())
|
||||||
|
|| (nm == flightgear::ErrorReporter::staticSubsystemClassId())
|
||||||
|
)
|
||||||
{
|
{
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue