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:
parent
6ce33fcb5c
commit
331ef3232f
1 changed files with 1 additions and 1 deletions
|
@ -490,8 +490,8 @@ unsigned FGEventInput::AddDevice( FGInputDevice * inputDevice )
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
catch( ... ) {
|
catch( ... ) {
|
||||||
delete inputDevice;
|
|
||||||
SG_LOG(SG_INPUT, SG_ALERT, "can't open InputDevice " << inputDevice->GetUniqueName() );
|
SG_LOG(SG_INPUT, SG_ALERT, "can't open InputDevice " << inputDevice->GetUniqueName() );
|
||||||
|
delete inputDevice;
|
||||||
return INVALID_DEVICE_INDEX;
|
return INVALID_DEVICE_INDEX;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue