| Summary: | CGContext: invalid context 0x0 | ||
|---|---|---|---|
| Product: | SDL | Reporter: | sabino.paulicelli |
| Component: | render | Assignee: | Sam Lantinga <slouken> |
| Status: | RESOLVED FIXED | QA Contact: | Sam Lantinga <slouken> |
| Severity: | major | ||
| Priority: | P2 | CC: | amaranth72, pauli.jokela, seant29373 |
| Version: | 2.0.9 | ||
| Hardware: | x86_64 | ||
| OS: | Other | ||
|
Description
sabino.paulicelli
2019-01-24 20:00:00 UTC
Sorry for any mistake or missed info. This is my first bug report. :] I also replicated this using the example at https://wiki.libsdl.org/SDL_CreateRenderer written in C I'm getting the same error on OSX Mojave 10.14.4.
If I set the environment variable CG_CONTEXT_SHOW_BACKTRACE=1, then I get a larger stack trace:
2019-04-28 09:20:38.220672-0400 game[17831:2297463] [game] CGContextSetFillColorWithColor: invalid context 0x0. Backtrace:
<_setColorWithFillAndStroke+152>
<-[SDLView drawRect:]+45>
<-[_NSOpenGLViewBackingLayer display]+901>
<_ZN2CA5Layer17display_if_neededEPNS_11TransactionE+627>
<_ZN2CA7Context18commit_transactionEPNS_11TransactionE+342>
<_ZN2CA11Transaction6commitEv+588>
<__65+[CATransaction(NSCATransaction) NS_setFlushesWithDisplayRefresh]_block_invoke+274>
<__CFRUNLOOP_IS_CALLING_OUT_TO_AN_OBSERVER_CALLBACK_FUNCTION__+23>
<__CFRunLoopDoObservers+451>
<__CFRunLoopRun+1136>
<CFRunLoopRunSpecific+455>
<RunCurrentEventLoopInMode+292>
<ReceiveNextEventCommon+355>
<_BlockUntilNextEventMatchingListInModeWithFilter+64>
<_DPSNextEvent+965>
<-[NSApplication(NSEvent) _nextEventMatchingEventMask:untilDate:inMode:dequeue:]+1361>
<Cocoa_PumpEvents+138>
<SDL_WaitEventTimeout_REAL+203>
<event_pump+59>
<event_loop+768>
<main+2067>
<start+1> 1
2019-04-28 09:20:38.223688-0400 game[17831:2297463] [game] CGContextGetCompositeOperation: invalid context 0x0. Backtrace:
<CGContextGetCompositeOperation+45>
<NSRectFill+154>
<-[SDLView drawRect:]+70>
<-[_NSOpenGLViewBackingLayer display]+901>
<_ZN2CA5Layer17display_if_neededEPNS_11TransactionE+627>
<_ZN2CA7Context18commit_transactionEPNS_11TransactionE+342>
<_ZN2CA11Transaction6commitEv+588>
<__65+[CATransaction(NSCATransaction) NS_setFlushesWithDisplayRefresh]_block_invoke+274>
<__CFRUNLOOP_IS_CALLING_OUT_TO_AN_OBSERVER_CALLBACK_FUNCTION__+23>
<__CFRunLoopDoObservers+451>
<__CFRunLoopRun+1136>
<CFRunLoopRunSpecific+455>
<RunCurrentEventLoopInMode+292>
<ReceiveNextEventCommon+355>
<_BlockUntilNextEventMatchingListInModeWithFilter+64>
<_DPSNextEvent+965>
<-[NSApplication(NSEvent) _nextEventMatchingEventMask:untilDate:inMode:dequeue:]+1361>
<Cocoa_PumpEvents+138>
<SDL_WaitEventTimeout_REAL+203>
<event_pump+59>
<event_loop+768>
<main+2067>
<start+1> 1
2019-04-28 09:20:38.224341-0400 game[17831:2297463] [game] CGContextSetCompositeOperation: invalid context 0x0. Backtrace:
<NSRectFill+209>
<-[SDLView drawRect:]+70>
<-[_NSOpenGLViewBackingLayer display]+901>
<_ZN2CA5Layer17display_if_neededEPNS_11TransactionE+627>
<_ZN2CA7Context18commit_transactionEPNS_11TransactionE+342>
<_ZN2CA11Transaction6commitEv+588>
<__65+[CATransaction(NSCATransaction) NS_setFlushesWithDisplayRefresh]_block_invoke+274>
<__CFRUNLOOP_IS_CALLING_OUT_TO_AN_OBSERVER_CALLBACK_FUNCTION__+23>
<__CFRunLoopDoObservers+451>
<__CFRunLoopRun+1136>
<CFRunLoopRunSpecific+455>
<RunCurrentEventLoopInMode+292>
<ReceiveNextEventCommon+355>
<_BlockUntilNextEventMatchingListInModeWithFilter+64>
<_DPSNextEvent+965>
<-[NSApplication(NSEvent) _nextEventMatchingEventMask:untilDate:inMode:dequeue:]+1361>
<Cocoa_PumpEvents+138>
<SDL_WaitEventTimeout_REAL+203>
<event_pump+59>
<event_loop+768>
<main+2067>
<start+1> 1
2019-04-28 09:20:38.224992-0400 game[17831:2297463] [game] CGContextFillRects: invalid context 0x0. Backtrace:
<CGContextFillRect+105>
<NSRectFill+237>
<-[SDLView drawRect:]+70>
<-[_NSOpenGLViewBackingLayer display]+901>
<_ZN2CA5Layer17display_if_neededEPNS_11TransactionE+627>
<_ZN2CA7Context18commit_transactionEPNS_11TransactionE+342>
<_ZN2CA11Transaction6commitEv+588>
<__65+[CATransaction(NSCATransaction) NS_setFlushesWithDisplayRefresh]_block_invoke+274>
<__CFRUNLOOP_IS_CALLING_OUT_TO_AN_OBSERVER_CALLBACK_FUNCTION__+23>
<__CFRunLoopDoObservers+451>
<__CFRunLoopRun+1136>
<CFRunLoopRunSpecific+455>
<RunCurrentEventLoopInMode+292>
<ReceiveNextEventCommon+355>
<_BlockUntilNextEventMatchingListInModeWithFilter+64>
<_DPSNextEvent+965>
<-[NSApplication(NSEvent) _nextEventMatchingEventMask:untilDate:inMode:dequeue:]+1361>
<Cocoa_PumpEvents+138>
<SDL_WaitEventTimeout_REAL+203>
<event_pump+59>
<event_loop+768>
<main+2067>
<start+1> 1
2019-04-28 09:20:38.225645-0400 game[17831:2297463] [game] CGContextSetCompositeOperation: invalid context 0x0. Backtrace:
<NSRectFill+252>
<-[SDLView drawRect:]+70>
<-[_NSOpenGLViewBackingLayer display]+901>
<_ZN2CA5Layer17display_if_neededEPNS_11TransactionE+627>
<_ZN2CA7Context18commit_transactionEPNS_11TransactionE+342>
<_ZN2CA11Transaction6commitEv+588>
<__65+[CATransaction(NSCATransaction) NS_setFlushesWithDisplayRefresh]_block_invoke+274>
<__CFRUNLOOP_IS_CALLING_OUT_TO_AN_OBSERVER_CALLBACK_FUNCTION__+23>
<__CFRunLoopDoObservers+451>
<__CFRunLoopRun+1136>
<CFRunLoopRunSpecific+455>
<RunCurrentEventLoopInMode+292>
<ReceiveNextEventCommon+355>
<_BlockUntilNextEventMatchingListInModeWithFilter+64>
<_DPSNextEvent+965>
<-[NSApplication(NSEvent) _nextEventMatchingEventMask:untilDate:inMode:dequeue:]+1361>
<Cocoa_PumpEvents+138>
<SDL_WaitEventTimeout_REAL+203>
<event_pump+59>
<event_loop+768>
<main+2067>
<start+1> 1
(tart, main, event_loop, and event_pump is all my code... I'm calling SDL_PollEvent inside event_pump)
https://hg.libsdl.org/SDL/rev/065b94926987 should fix it. |