added return in guard clause for empty drawcmd buffer
draw(cmd) had a bug causing the first drawcmd in every frame to be added twice, for text this would cause a double freepull/2/head
parent
2b927259a8
commit
b898fd5b31
|
@ -344,6 +344,7 @@ void insert_drawcmd_at(size_t index, const drawcmd_t* cmd) {
|
||||||
void draw(const drawcmd_t* cmd) {
|
void draw(const drawcmd_t* cmd) {
|
||||||
if(g_drawdata_endptr == g_drawdata) {
|
if(g_drawdata_endptr == g_drawdata) {
|
||||||
insert_drawcmd_at(0, cmd);
|
insert_drawcmd_at(0, cmd);
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
long top = (size_t)(g_drawdata_endptr - g_drawdata),
|
long top = (size_t)(g_drawdata_endptr - g_drawdata),
|
||||||
bot = 0,
|
bot = 0,
|
||||||
|
|
Loading…
Reference in New Issue