关闭视图控制器不会释放内存

时间:2016-11-09 11:12:25

标签: cocoa memory-management memory-leaks xamarin.mac

我的应用程序中有几个模态,这里是我用于每个模式的扩展方法:

> x=1:5
> str=sprintf("hi %d",x)
> str
[1] "hi 1" "hi 2" "hi 3" "hi 4" "hi 5"
> 

但是我没有释放内存,这里是分析器的屏幕截图:

enter image description here

最后,这种情况导致应用程序崩溃....

我正在使用PrepareForSegue方法将数据从源传递到目标vc,如下所示:

public static void CloseAndDismissViewController (this NSViewController vc)
        {
            vc.View.Window.Close ();    
            vc.DismissController (vc);
            vc.RemoveFromParentViewController ();
        }

0 个答案:

没有答案
相关问题