I'm using the Messenger Plugin in my MvvmCross application and have noticed that it sometimes purges my subscriptions ("One or more listeners failed - purge scheduled"). This is causing an error in my application. By default I am using the weak reference for the subscriptions and I am not unsubscribing from the message.
Do I need to be Unsubscribing? Isn't the point of a weak reference to allow it to be garbage collected?
My BaseView is subscribing in the constructor as shown below.
public BaseView()
{
_messenger = Mvx.Resolve<IMvxMessenger>();
_messenger.Subscribe<MyMessage>(s => Method());
}
Below is my Broadcast Receiver publishing my message.
var _messenger = Mvx.Resolve<IMvxMessenger>();
_messenger.Publish<MyMessage>(new MyMessage(this));
I have an idea of trying to unsubscribe in the onDestroy.
If you could give me some insight as to why this is happening and a possible resolution I would be grateful.
Thanks in advance.