0
\$\begingroup\$

I am using pygame on a mac, and when the app runs, it draws a frame of the screen fine, and then crashes with the following error:

Assertion failed: (NSViewIsCurrentlyBuildingLayerTreeForDisplay() != currentlyBuildingLayerTree), 
function NSViewSetCurrentlyBuildingLayerTreeForDisplay, 
file /BuildRoot/Library/Caches/com.apple.xbs/Sources/AppKit/AppKit-1561.10.101/AppKit.subproj/NSView.m, 
line 14480.

Everything was working fine, but I did switch to multi-threading, and I think this might be related. Has anyone a clue as to what might be going wrong?

I call:

pygame.init()
pygame_size = 1280, 960  # image dimensions
pygame_screen = pygame.display.set_mode(pygame_size)

in the main thread, and then I have many pygame draw calls.

\$\endgroup\$
3
  • \$\begingroup\$ Do you touch any pygame functions from a non-main thread? \$\endgroup\$ Commented Dec 8, 2017 at 13:46
  • \$\begingroup\$ Yes. So, Thinking this might be the problem now. I am actually using it as part of running tests and trying to save screen captures of the tests. I am not actually trying to run a multi-threaded game. \$\endgroup\$ Commented Dec 8, 2017 at 13:49
  • 1
    \$\begingroup\$ YES! I moved the screen creation into the main thread, and now it is not crashing! \$\endgroup\$ Commented Dec 8, 2017 at 14:01

0

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.