linuxgurugamer / ClickThroughBlocker

GNU Lesser General Public License v3.0
31 stars 17 forks source link

NRE spam in ClickThroughFix.OnGUILoopCount.DoGuiCounter () #8

Closed chippydip closed 4 years ago

chippydip commented 4 years ago

v0.1.7.2 (RP-1 install), seems to happen when simulating a craft with KRASH. I took a look at the code and my best guess is an editor lock is being set by the KRASH window and then starting the sim switches to the flight scene before the lock is removed causing it to get stuck in a state where weLockedEditorInputs is true but EditorLogic.fetch is null (I don't see how it's possible for anything else in that method to ever be null)?

Initially this wasn't noticeable except for the log spam, but after reverting the sim to launch I kept losing the ability to rotate the camera until I manually cleared input locks in the debug window. I'm guessing another lock was added to the list (probably for the KRASH revert window) and the NRE prevented all other locks from being cleaned up as well.

chippydip commented 4 years ago

I added that null check and haven't seen the issue since, so I think that was indeed the cause:

if (EditorLogic.fetch != null && win.weLockedEditorInputs) { ... }

linuxgurugamer commented 4 years ago

Thanks, I'll get it fixed

linuxgurugamer commented 4 years ago

Would have been nice if you told me where you put that check. I'm at work, so can't really dig now

chippydip commented 4 years ago

oops, sorry, thanks for the fix, though!