Closed hellozhangchi closed 2 weeks ago
Can you try the latest version (updated today) with valgrind to try to find the leak? I was not able to find any leaks in nanovgXC itself with valgrind memcheck.
Also, since the shaders are compiled every time NVGcontext is created, it would be better to reuse the same NVGcontext if possible.
I have a drawing plugin that loads every time I need to draw, and unloads after drawing. NVGcontext keeps on creating and destroying, which in this case triggers a serious memory leak. You can test this with the following code `while (!glfwWindowShouldClose(window)) { vg = nvglCreate(NVG_SRGB); //NVG_DEBUG); double mx, my, t, dt; int winWidth, winHeight; int fbWidth, fbHeight; float pxRatio; int prevFBO; float gpuTimes[3]; int i, n;
}`