fix: submenu should be autoreleased (#25617)

This commit is contained in:
Cheng Zhao 2020-09-30 01:56:46 +09:00 committed by GitHub
parent 01dc50d829
commit d2282ac51a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -297,7 +297,7 @@ static base::scoped_nsobject<NSMenu> recentDocumentsMenuSwap_;
[item setTarget:nil];
[item setAction:nil];
NSMenu* submenu = [[NSMenu alloc] initWithTitle:label];
NSMenu* submenu = [[[NSMenu alloc] initWithTitle:label] autorelease];
[item setSubmenu:submenu];
[NSApp setServicesMenu:submenu];
} else if (type == electron::ElectronMenuModel::TYPE_SUBMENU &&