--- a/src/video/mac/vlcmacwidget.mm +++ b/src/video/mac/vlcmacwidget.mm 2026-08-14 20:10:44.000000000 +0800 @@ -16,8 +16,8 @@ */ #include "vlcmacwidget.h" -#import -#import "nsvideoview.h" +#include +#include "nsvideoview.h" #include @@ -25,15 +25,17 @@ { // Many Cocoa objects create temporary autorelease objects, // so create a pool to catch them. - @autoreleasepool { - VideoView *videoView = [[VideoView alloc] init]; + NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init]; - this->setCocoaView(videoView); + VideoView *videoView = [[VideoView alloc] init]; - // Release our reference, since our super class takes ownership and we - // don't need it anymore (except with Qt 5.8.0 because of a regression). - if (strcmp(qVersion(), "5.8.0")) { - [videoView release]; - } + this->setCocoaView(videoView); + + // Release our reference, since our super class takes ownership and we + // don't need it anymore (except with Qt 5.8.0 because of a regression). + if (strcmp(qVersion(), "5.8.0")) { + [videoView release]; } + + [pool release]; }