Browse Source

Merge pull request #115 from cforfang/small_fixes

Memory leak + small fixes
shared-context
Mikko Mononen 11 years ago
parent
commit
197af889db
2 changed files with 7 additions and 2 deletions
  1. +2
    -2
      src/nanovg.c
  2. +5
    -0
      src/nanovg_gl.h

+ 2
- 2
src/nanovg.c View File

@@ -151,7 +151,7 @@ static void nvg__deletePathCache(struct NVGpathCache* c)
free(c);
}

static struct NVGpathCache* nvg__allocPathCache()
static struct NVGpathCache* nvg__allocPathCache(void)
{
struct NVGpathCache* c = (struct NVGpathCache*)malloc(sizeof(struct NVGpathCache));
if (c == NULL) goto error;
@@ -1444,7 +1444,7 @@ static void nvg__calculateJoins(struct NVGcontext* ctx, float w, int lineJoin, f
{
struct NVGpathCache* cache = ctx->cache;
int i, j;
float iw;
float iw = 0.0f;

if (w > 0.0f) iw = 1.0f / w;



+ 5
- 0
src/nanovg_gl.h View File

@@ -1332,6 +1332,11 @@ static void glnvg__renderDelete(void* uptr)
}
free(gl->textures);

free(gl->paths);
free(gl->verts);
free(gl->uniforms);
free(gl->calls);

free(gl);
}



Loading…
Cancel
Save