When exiting the application and disconnecting libomv, one gets a NullReferenceException. This was traced to the TexturePipeline unregistering an event. Looking at the code in EventDictionary.UnRegisterEvent, when the last event is removed from the callback, the callback goes to null making the reference to the GetInvocationList test throw an exception. The code in EventDictionary.UnRegisterEvent should read:
if (_EventTable.TryGetValue(packetType, out callback))
callback.Callback -= eventHandler;
if (callback.Callback == null || callback.Callback.GetInvocationList().Length == 0)
which checks for the extra case of the callback being empty/null.
Initialize libomv, fetch some textures (thus using TexturePipeline) then perform disconnect.
Change applied, thanks!