Opened 10 years ago

Last modified 10 years ago

#136 new defect

If Win32Window::activate() fails, a crash may follow

Reported by: marcusl Owned by: unassigned
Priority: major Milestone:
Component: System Version: 2.0
Keywords: Cc:

Description

If no gl-context is available for thread, the glGetString(GL_EXTENSIONS) returns null, which isn't handled correctly.

The right way would be to check if activate() succeeds and not try to render if it doesn't, something like the following (without calling activate twice)

  m_win->activate();

  if (wglGetCurrentContext()) {

        m_win->render(m_action);

  } 

I get this when I try to render from a different thread than what I created the window in. (I'm working on the actual cause for this, noticing the brittle error handling in the process.)

Change History (1)

comment:1 Changed 10 years ago by dirk

  • Version changed from 1.8 to 2.0

To fix this activate would have to be able to detect whether it failed and return it's status. Also the whole needs to be able to handle the case that no context is active.

This is too much for 1.8, IMHO. I'll move it 2.0 and we can look at it again.

Note: See TracTickets for help on using tickets.