Nabeel Posted Monday at 03:30 PM Report Posted Monday at 03:30 PM Hello, Seeing this error from some clients: Quote V:0728 14:18:03 Disposing SimConnect client E:0728 14:18:03 UnhandledException: UncaughtException::System.NullReferenceException System.NullReferenceException: Object reference not set to an instance of an object. at FSUIPC.MSFSVariableServices.receiveValuesCallback(String name, Double value) at FSUIPC.WAPI.fsuipcw_getLvarValues(ReceiveValuesCallback ReceiveFunction) at FSUIPC.MSFSVariableServices.refreshData() at FSUIPC.MSFSVariableServices.lvarsValueChanged(IntPtr id, IntPtr Value) V:0728 14:18:03 Disposal completed, marked for gc I:0728 14:18:03 Sim client disconnected This is my (shortened) shutdown code, but I'm sometimes seeing this error (pulling from crash logs) if (VS.IsRunning) { VS.Stop(); } // Remove the handler if (callbackAdded) { Log.Verbose("Removing callbacks"); VS.OnValuesChanged -= VS_OnValuesChanged; VS.OnLogEntryReceived -= VS_OnLogEntryReceived; callbackAdded = false; } try { Log.Verbose("Disposing SimConnect client"); _simconnect?.Dispose(); Log.Verbose("Disposal completed, marked for gc"); _simconnect = null; } catch (COMException) { // ignore - sim already said bye bye }
Paul Henty Posted yesterday at 01:01 PM Report Posted yesterday at 01:01 PM I've had a look - The Stop() method wasn't entirely thread-safe, so that might be causing this issue. I've fixed this in 3.3.17-beta, now on Nuget. (Tick the box that says "Show Pre-Release"). Let me know if it's still a problem and I'll look into it some more. Paul
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now