#OpenGL memory leak aaa

14 messages · Page 1 of 1 (latest)

tulip quartz
#

I encountered a memory leak when using valgrind, it stems from the calling of glfwInit despite that I call glfwTerminate at the end of the main function. What am I doing wrong?

This code below is barely edited, being very similar to the "example" opengl code for a window.

south cypressBOT
#

When your question is answered use !solved to mark the question as resolved.

Remember to ask specific questions, provide necessary details, and reduce your question to its simplest form. For tips on how to ask a good question run !howto ask.

tropic path
#

you have to live with it

#

opengl one time allocates memory that it never frees

tulip quartz
#

it's only 0.012 mb so it should be fine

tropic path
#

dont ask me

#

since its been created prolly

tulip quartz
#

pain

#

thanks for your help though

tropic path
#
vg_gen_supp_file:
    @printf "#define GLEW_STATIC\n#include <GL/glew.h>\n#include <GLFW/glfw3.h>\n\
    int main(void) {\nglfwInit();\nglfwTerminate();\n}" > $(SRC_DIR)/vgmain.c
    @$(CC) $(CFLAGS) $(SRC_DIR)/vgmain.c -o $(EXE) $(IFLAGS) $(LFLAGS)
    @valgrind \
    --leak-check=full \
    --show-reachable=yes \
    --error-limit=no \
    --gen-suppressions=all \
    --log-file=vg.supp \
    ./$(EXE)
    @sed -i 's/==.*$///g' vg.supp
    @awk 'NF' vg.supp > tmp && mv tmp vg.supp
    @rm -f $(SRC_DIR)/vgmain.c

i had this to generate me a suppression file automatically

south cypressBOT
#

This question thread is being automatically closed. If your question is not answered feel free to bump the post or re-ask. Take a look at !howto ask for tips on improving your question.