mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-10 03:19:40 +00:00
[613/906] window_cocoa: fix segfault with gst-launch-1.0 -e ... and sending SIGINT (Ctrl-C)
GNUstep has a signal handler for SIGINT which runs in the main thread. However that thread has never been 'registered' with GNUstep so the autorelease magic of objective-c causes a segfault from accessing a null NSThread object somewhere deep in GNUstep.
This commit is contained in:
parent
c080c6c910
commit
48ccfcc918
1 changed files with 11 additions and 0 deletions
|
@ -588,6 +588,17 @@ gst_gl_window_cocoa_send_message (GstGLWindow * window, GstGLWindowCB callback,
|
|||
}
|
||||
|
||||
- (void) applicationWillTerminate:(NSNotification *)aNotification {
|
||||
#ifdef GNUSTEP
|
||||
/* fixes segfault with gst-launch-1.0 -e ... and sending SIGINT (Ctrl-C)
|
||||
* which causes GNUstep to run a signal handler in the main thread.
|
||||
* However that thread has never been 'registered' with GNUstep so
|
||||
* the autorelease magic of objective-c causes a segfault from accessing
|
||||
* a null NSThread object somewhere deep in GNUstep.
|
||||
*
|
||||
* I put it here because this is the first time we can register the thread.
|
||||
*/
|
||||
GSRegisterCurrentThread();
|
||||
#endif
|
||||
}
|
||||
|
||||
@end
|
||||
|
|
Loading…
Reference in a new issue