summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/gl_draw.cxx10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/gl_draw.cxx b/src/gl_draw.cxx
index 52222b4fc..e9c34c12c 100644
--- a/src/gl_draw.cxx
+++ b/src/gl_draw.cxx
@@ -478,8 +478,12 @@ int gl_texture_fifo::compute_texture(const char* str, int n)
current = (current + 1) % size_;
if (current > last) last = current;
//write str to a bitmap just big enough
+ if ( fifo[current].utf8 ) free(fifo[current].utf8);
+ fifo[current].utf8 = (char *)malloc(n + 1);
+ memcpy(fifo[current].utf8, str, n);
+ fifo[current].utf8[n] = 0;
fifo[current].width = 0, fifo[current].height = 0;
- fl_measure(str, fifo[current].width, fifo[current].height, 0);
+ fl_measure(fifo[current].utf8, fifo[current].width, fifo[current].height, 0);
CGColorSpaceRef lut = CGColorSpaceCreateDeviceRGB();
void *base = calloc(4*fifo[current].width, fifo[current].height);
if (base == NULL) return -1;
@@ -500,10 +504,6 @@ int gl_texture_fifo::compute_texture(const char* str, int n)
CGContextRelease(fl_gc);
fl_gc = NULL;
free(base);
- if ( fifo[current].utf8 ) free(fifo[current].utf8);
- fifo[current].utf8 = (char *)malloc(n + 1);
- memcpy(fifo[current].utf8, str, n);
- fifo[current].utf8[n] = 0;
fifo[current].fdesc = gl_fontsize;
return current;
}