public Subscriber(IStream stream) { _callbacks = new SubscriberNative.otc_subscriber_cb(); _callbacks.userData = (IntPtr)GCHandle.Alloc(this); _subscriber = SubscriberNative.otc_subscriber_new(stream.GetNativeReference(), ref _callbacks); }
public void Dispose() { ((GCHandle)_callbacks.userData).Free(); SubscriberNative.otc_subscriber_delete(_subscriber); }