1
0
Fork 0

src/Input/FGEventInput.cxx: FGEventInput::AddDevice(): fix incorrect use after delete.

Moved delete of inputDevice to after its use in a SG_LOG diagnostic.
This commit is contained in:
Julian Smith 2019-08-14 11:26:55 +01:00
parent 6ce33fcb5c
commit 331ef3232f

View file

@ -490,8 +490,8 @@ unsigned FGEventInput::AddDevice( FGInputDevice * inputDevice )
}
}
catch( ... ) {
delete inputDevice;
SG_LOG(SG_INPUT, SG_ALERT, "can't open InputDevice " << inputDevice->GetUniqueName() );
delete inputDevice;
return INVALID_DEVICE_INDEX;
}