Cocoa/highgui: fix leak in cvGetWindowRect_COCOA

This commit is contained in:
Neko Asakura 2024-12-14 04:34:43 +10:00
parent 1d4110884b
commit dbb330d7be

View File

@ -662,6 +662,7 @@ CvRect cvGetWindowRect_COCOA( const char* name )
{
CV_ERROR( CV_StsNullPtr, "NULL window" );
} else {
@autoreleasepool {
NSRect rect = [window frame];
#if MAC_OS_X_VERSION_MAX_ALLOWED > MAC_OS_X_VERSION_10_6
NSPoint pt = [window convertRectToScreen:rect].origin;
@ -671,6 +672,7 @@ CvRect cvGetWindowRect_COCOA( const char* name )
NSSize sz = [[[window contentView] image] size];
result = cvRect(pt.x, pt.y, sz.width, sz.height);
}
}
__END__;
return result;