Fix 'attempt to flush unmapped buffer' when creating empty Mesh;

This commit is contained in:
bjorn 2021-03-04 22:19:08 -07:00
parent a3b791a7e7
commit deb756392b
1 changed files with 3 additions and 2 deletions

View File

@ -1413,10 +1413,11 @@ static int l_lovrGraphicsNewMesh(lua_State* L) {
lua_pop(L, 1);
}
}
lovrBufferFlush(vertexBuffer, 0, count * stride);
lovrBufferUnmap(vertexBuffer);
}
lovrBufferFlush(vertexBuffer, 0, count * stride);
lovrBufferUnmap(vertexBuffer);
lovrRelease(vertexBuffer, lovrBufferDestroy);
luax_pushtype(L, Mesh, mesh);