GLES2: double-free crash caused by non-unowned return value of glGetString
Hello, I found an issue of glew2 binding.
Currently in the gles2.vapi
, signature of glGetString
is string glGetString (GLenum name);
. When calling this function, it will generate C code like:
_tmp3_ = glGetString (GL_VERSION);
_tmp4_ = _tmp3_;
g_print ("version: %s\n", _tmp4_);
_g_free0 (_tmp4_);
But the buffer of glGetString
function's return value is managed by gl itself, so the ending _g_free0(_tmp4_)
will cause glDestoryWindow
call's double-free crash.
Maybe we need to change signature of glGetString
to unowned string glGetString (GLenum name)
.
Edited by dykai