threading this method produces a segfault, why?
问题 So im using GLFW and the following method works when called in my main method void Display::run() { while (!glfwWindowShouldClose(window)) { /* Render here */ /* Swap Buffers And Poll */ glfwSwapBuffers(window); glfwPollEvents(); } } but when i try to run it on a separate thread i get a segfault std::thread t1(&Display::run, this); any ideas? ask if you want any more of the code Edit: main.cpp #include "src/support/Display.h" int main() { Display* d; d->start(); return 0; } Display.h #include