[vlc-commits] qt: drop legacy NSAutoreleasePool pattern
Felix Paul Kühne
git at videolan.org
Thu Sep 3 11:16:28 CEST 2015
vlc | branch: master | Felix Paul Kühne <fkuehne at videolan.org> | Thu Sep 3 11:15:49 2015 +0200| [aac85143da14fc028d1447ef6c2641df8954bc73] | committer: Felix Paul Kühne
qt: drop legacy NSAutoreleasePool pattern
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=aac85143da14fc028d1447ef6c2641df8954bc73
---
modules/gui/qt4/util/searchlineedit_mac.mm | 31 +++++++++++++---------------
1 file changed, 14 insertions(+), 17 deletions(-)
diff --git a/modules/gui/qt4/util/searchlineedit_mac.mm b/modules/gui/qt4/util/searchlineedit_mac.mm
index 6d4da6c..3ab3862 100644
--- a/modules/gui/qt4/util/searchlineedit_mac.mm
+++ b/modules/gui/qt4/util/searchlineedit_mac.mm
@@ -41,23 +41,20 @@ SearchLineEdit::SearchLineEdit(QWidget *parent)
{
// Many Cocoa objects create temporary autorelease objects,
// so create a pool to catch them.
- NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
-
- // Create the NSSearchField, set it on the QCocoaViewContainer.
- NSSearchField *search = [[NSSearchField alloc] init];
- setCocoaView(search);
- [[search cell] setPlaceholderString:@"Search..."];
-
- // Use a Qt menu for the search field menu.
- // NSMenu *nsMenu = searchMenu->macMenu(0);
- // [[search cell] setSearchMenuTemplate:nsMenu];
-
- // Release our reference, since our super class takes ownership and we
- // don't need it anymore.
- [search release];
-
- // Clean up our pool as we no longer need it.
- [pool release];
+ @autoreleasepool {
+ // Create the NSSearchField, set it on the QCocoaViewContainer.
+ NSSearchField *search = [[NSSearchField alloc] init];
+ setCocoaView(search);
+ [[search cell] setPlaceholderString:@"Search..."];
+
+ // Use a Qt menu for the search field menu.
+ // NSMenu *nsMenu = searchMenu->macMenu(0);
+ // [[search cell] setSearchMenuTemplate:nsMenu];
+
+ // Release our reference, since our super class takes ownership and we
+ // don't need it anymore.
+ [search release];
+ }
}
//![0]
More information about the vlc-commits
mailing list