Fixed memory leak caused by glutMainLoop() not returning.

Fixed memory leak by allowing glutMainLoop() to return to allow for the scene and streams to be released.
pull/3036/head
Marc-Antoine Lortie 2020-03-06 13:28:05 -05:00
parent 673a1dcea5
commit c620e9a2ac
1 changed files with 3 additions and 2 deletions

View File

@ -15,9 +15,9 @@
#include <stdio.h> #include <stdio.h>
#ifdef __APPLE__ #ifdef __APPLE__
#include <glut.h> #include <freeglut.h>
#else #else
#include <GL/glut.h> #include <GL/freeglut.h>
#endif #endif
/* assimp include files. These three are usually needed. */ /* assimp include files. These three are usually needed. */
@ -392,6 +392,7 @@ int main(int argc, char **argv)
glutInitWindowPosition(100,100); glutInitWindowPosition(100,100);
glutInitDisplayMode(GLUT_RGB | GLUT_DOUBLE | GLUT_DEPTH); glutInitDisplayMode(GLUT_RGB | GLUT_DOUBLE | GLUT_DEPTH);
glutInit(&argc, argv); glutInit(&argc, argv);
glutSetOption(GLUT_ACTION_ON_WINDOW_CLOSE, GLUT_ACTION_GLUTMAINLOOP_RETURNS);
glutCreateWindow("Assimp - Very simple OpenGL sample"); glutCreateWindow("Assimp - Very simple OpenGL sample");
glutDisplayFunc(display); glutDisplayFunc(display);