gl: Cocoa window is never closed
More technical description
GstGLWindowCocoa
fails to close the window it creates.
Reproduction steps
Create a bunch of pipelines outputting to glimagesink
with GST_GL_HAVE_WINDOW_COCOA
defined. Windows will be created, and they will never be closed.
They will not be closed if the pipeline state is set to NULL
nor if the pipeline and glimagesink
are deleted.
Expected result
With GST_GL_HAVE_WINDOW_X11
defined the glimagesink
element will close the window when the state is set to NULL
.
Suspected issue
gstglwindow_cocoa.m#L207 creates the Cocoa window:
internal_win_id = [[GstGLNSWindow alloc] initWithContentRect:rect styleMask:
(NSWindowStyleMaskTitled | NSWindowStyleMaskClosable |
NSWindowStyleMaskResizable | NSWindowStyleMaskMiniaturizable)
backing: NSBackingStoreBuffered defer: NO screen: nil gstWin: window_cocoa];
I believe that gstglwindow_cocoa.m#L244 should close the window, but instead it just deleted the view from within the window:
[[internal_win_id contentView] removeFromSuperview];
I suspect that the above line should be replaced with:
[internal_win_id close];