我的代码如下:(执行之前已经初始化来的)while(1){gluintgl_handle1=glCreateShader(GL_VERTEX_SHADER);gluint...
我的代码如下:(执行之前已经初始化来的)
while(1)
{
gluint gl_handle1 = glCreateShader(GL_VERTEX_SHADER);
gluint gl_handle2 = glCreateShader(GL_FRAGMENT_SHADER);
glShaderSource (gl_handle1, 1, &priv->source1, NULL);
glShaderSource (gl_handle2, 1, &priv->source2, NULL);
glCompileShader (gl_handle1);
glCompileShader (gl_handle2);
gluint program = glCreateProgram ();
glAttachShader(program, gl_handle1);
glAttachShader(program, gl_handle2);
glLinkProgram(program);
glDeleteShader(gl_handle1);
glDeleteShader(gl_handle2);
glDetachShader(program, gl_handle1);
glDetachShader(program, gl_handle2);
glDeleteProgram(program);
}反复的地用这段代码,我发现我的内存是不断上涨的,这是为什么呢?求大神科普啊,很急哦