MvxBaseActivityAdapter中的mvvmcross memoryleak

时间:2015-11-16 15:23:42

标签: android memory-leaks mvvmcross

现在我看一下mvvmcross源代码,看看在MvxBaseActivityAdapter类中初始化事件处理程序

_eventSource.CreateCalled += EventSourceOnCreateCalled;
        _eventSource.CreateWillBeCalled += EventSourceOnCreateWillBeCalled;
        _eventSource.StartCalled += EventSourceOnStartCalled;
        _eventSource.RestartCalled += EventSourceOnRestartCalled;
        _eventSource.ResumeCalled += EventSourceOnResumeCalled;
        _eventSource.PauseCalled += EventSourceOnPauseCalled;
        _eventSource.StopCalled += EventSourceOnStopCalled;
        _eventSource.DestroyCalled += EventSourceOnDestroyCalled;
        _eventSource.DisposeCalled += EventSourceOnDisposeCalled;
        _eventSource.SaveInstanceStateCalled += EventSourceOnSaveInstanceStateCalled;
        _eventSource.NewIntentCalled += EventSourceOnNewIntentCalled;

        _eventSource.ActivityResultCalled += EventSourceOnActivityResultCalled;
        _eventSource.StartActivityForResultCalled += EventSourceOnStartActivityForResultCalled;

但是没有代码可以清除此事件处理程序。 因此,当我使用xamarin分析器分析我自己的应用程序时,活动不会被破坏,因为它依赖于MvxActivityAdapter和MvxBindingActivityAdapter,并且它们引用了这些事件处理程序。 这是mvvmcross的错误还是我应该手动清除事件(但不确定它是否可行)? 感谢

0 个答案:

没有答案