diff options
author | Remko Tronçon <git@el-tramo.be> | 2013-01-01 09:17:15 (GMT) |
---|---|---|
committer | Remko Tronçon <git@el-tramo.be> | 2013-01-01 20:23:25 (GMT) |
commit | 3adfdcfdeabddc25d8234cbea4e5cd05b72d0a49 (patch) | |
tree | 7a848fe0216da527f1ebaf43de232ee7c6960729 /Slimber/Cocoa | |
parent | 6cedffb9368eeb05e199f7df80c4735f63735a94 (diff) | |
download | swift-3adfdcfdeabddc25d8234cbea4e5cd05b72d0a49.zip swift-3adfdcfdeabddc25d8234cbea4e5cd05b72d0a49.tar.bz2 |
Fix Objective-C memory leaks.
Change-Id: I62206d3813e8873f027ff46e525a30bcb2e945c9
Diffstat (limited to 'Slimber/Cocoa')
-rw-r--r-- | Slimber/Cocoa/CocoaMenulet.mm | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/Slimber/Cocoa/CocoaMenulet.mm b/Slimber/Cocoa/CocoaMenulet.mm index de9e9e9..c739fb4 100644 --- a/Slimber/Cocoa/CocoaMenulet.mm +++ b/Slimber/Cocoa/CocoaMenulet.mm @@ -1,3 +1,9 @@ +/* + * Copyright (c) 2012-2013 Remko Tronçon + * Licensed under the GNU General Public License v3. + * See Documentation/Licenses/GPLv3.txt for more information. + */ + #include "Slimber/Cocoa/CocoaMenulet.h" #pragma GCC diagnostic ignored "-Wold-style-cast" @@ -45,7 +51,7 @@ void CocoaMenulet::addItem(const std::string& name, const std::string& icon) { NSString* path = [[NSBundle mainBundle] pathForResource: [NSString stringWithUTF8String: icon.c_str()] ofType:@"png"]; NSImage* image = [[NSImage alloc] initWithContentsOfFile: path]; - [item setImage: [[NSImage alloc] initWithContentsOfFile: path]]; + [item setImage: image]; [image release]; } [menu addItem: item]; |