1
0
Fork 0

Attempting to fix crash with the Wright-flyer

Some users crash in the UIUC code during init; this change is to try
to understand why.

Sentry-Id: FLIGHTGEAR-SA
This commit is contained in:
James Turner 2020-12-17 10:29:47 +00:00
parent ae41eba3da
commit d7155bde38
2 changed files with 9 additions and 4 deletions

View file

@ -761,7 +761,7 @@ bool FGLaRCsim::copy_from_LaRCsim() {
// cout << "climb rate = " << -V_down * 60 << endl; // cout << "climb rate = " << -V_down * 60 << endl;
#ifdef ENABLE_UIUC_MODEL #ifdef ENABLE_UIUC_MODEL
if ( !strcmp(aero->getStringValue(), "uiuc") ) { if (!strcmp(aero->getStringValue(), "uiuc") && aircraft_) {
if (pilot_elev_no) { if (pilot_elev_no) {
globals->get_controls()->set_elevator(Long_control); globals->get_controls()->set_elevator(Long_control);
globals->get_controls()->set_elevator_trim(Long_trim); globals->get_controls()->set_elevator_trim(Long_trim);

View file

@ -85,9 +85,10 @@
#include <iostream> #include <iostream>
#include <cstring> #include <cstring>
#include <Main/fg_props.hxx>
#include <Main/sentryIntegration.hxx>
#include <simgear/compiler.h> #include <simgear/compiler.h>
#include <simgear/misc/sg_path.hxx> #include <simgear/misc/sg_path.hxx>
#include <Main/fg_props.hxx>
#include "uiuc_aircraft.h" #include "uiuc_aircraft.h"
#include "uiuc_coefficients.h" #include "uiuc_coefficients.h"
@ -159,8 +160,12 @@ void uiuc_initial_init ()
void uiuc_defaults_inits () void uiuc_defaults_inits ()
{ {
if (aircraft_ == 0) if (aircraft_ == 0) {
aircraft_ = new AIRCRAFT; // becuase we're getting crashes about aircraft_ being null, add
// an explicit breadcrumb at this point
flightgear::addSentryBreadcrumb("UIUC aircraf created", "info");
aircraft_ = new AIRCRAFT;
}
// set defaults and initialize (called once from uiuc_init_2_wrapper) // set defaults and initialize (called once from uiuc_init_2_wrapper)