[8.4.96.2019] Array cause memory leak on iOS


(James Esword) #1

IDE: VS 2015
Version: 8.4.96.2019
Target (If relevant): iOS
Description:

Found this problem by my unit tests after upgrade from 8.3.94.2001 to 8.4.96.2019.

iOSTest.zip (106.2 KB)

public class TestObj {
    public override void dealloc() {
        // will never be called
        Foundation.NSLog("TestObj dealloc!!!");
    }
}

[UIApplicationMain, IBObject]
class AppDelegate : IUIApplicationDelegate {
    public UIWindow window { get; set; }

    public BOOL application(UIApplication application) didFinishLaunchingWithOptions(NSDictionary launchOptions) {
        window = new UIWindow(UIScreen.mainScreen().bounds);
        window.rootViewController = new UIViewController withNibName(null) bundle(null);
        window.makeKeyAndVisible();

        // No strong ref will be kept
        var a = new TestObj[] {new TestObj()};
        a = null;

        return true;
    }

(RemObjects) #2

Thanks, logged as bugs://75686


(RemObjects) #3

bugs://75686 got closed with status fixed.


(Carlo Kok) #4

Just retested this: properly deallocates now.