When being subscribed to all inputevents via SubscribeInputEvent(0) the sim will CTD when restarting a flight.
The sim sends following sequence of events:
I can also reproduce a CTD by subscribing to just any one specific Input Event (by hash ID) and then switching airplane models.
For example:
Select the stock Icon model in World Map and go back to home/main menu.
Subscribe to HANDLING_ElevatorTrim_1 event, which for me is SubscribeInputEvent(18030404428114905164)
Change airplanes to VL3 in World Map and go back to Home.
If it doesn’t crash right away, go back and repeat step 3 but changing back to the Icon.
The most times I’ve had to repeat this is 2… YMMV.
Exception info: Unhandled exception at 0x00007FF71DDA4F10 (FlightSimulator.exe) in FlightSimulator.exe.27876.dmp: 0xC0000005: Access violation reading location 0xFFFFFFFFFFFFFFFF.
Note that the HANDLING_ElevatorTrim_1 has the same Hash ID in both models (as reported by EnumerateInputEvents()).
An even more reliable way to CTD, on first try every time for me:
Steps 1 and 2 as above.
3. Change to a model w/out elevator trim, eg. Cabri G2 heli, then ESC/Go Back.
4. Usually crashes before the home screen is even shown.
Exception info: Unhandled exception at 0x00007FF71DDA4EE9 (FlightSimulator.exe) in FlightSimulator.exe.21840.dmp: 0xC0000005: Access violation reading location 0x00000162293D5554.
This is all with Dev Mode enabled, since that’s the only way to get the list of input events right now anyway.
@GentleLynx This seems to me like same or similar issue, but do let me know if you’d like me to start a separate thread. I have debug dumps if that would help anything.
Thanks,
-Max
PS. From what I can tell, the first indication that a new aircraft is being loaded when navigating the main menu is the AircraftLoaded system event. Calling UnsubscribeInputEvent(18030404428114905164) at this point (outside/async of ReceiveMessage() for the OnRecvEventFilename handler) leads to an immediate sim exception.
FWIW, in all the crash scenarios I mentioned, after the AircraftLoaded event I consistently get SimStop, Sim {0}, PositionChanged, and then the exception.