mirror of
https://github.com/gnustep/libs-gui.git
synced 2025-05-30 03:00:37 +00:00
drawRun() now correctly flags that it wants some temporary memory
allocated. The old behaviour resulted in a memory leak. git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@14451 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
a928378a45
commit
e4bc6d4d9d
1 changed files with 2 additions and 3 deletions
|
@ -216,7 +216,7 @@ drawRun(GSTextRun *run, NSPoint origin, GSDrawInfo *draw)
|
|||
// glyph is an unicode char value
|
||||
// if the font has non-standard encoding we need to remap it.
|
||||
unichar u[run->glyphCount];
|
||||
char *r;
|
||||
char *r = NULL;
|
||||
unsigned l = run->glyphCount;
|
||||
unsigned s = 0;
|
||||
|
||||
|
@ -224,7 +224,7 @@ drawRun(GSTextRun *run, NSPoint origin, GSDrawInfo *draw)
|
|||
u[i] = run->glyphs[i].glyph;
|
||||
|
||||
if (GSFromUnicode((unsigned char**)&r, &s, u, l, enc,
|
||||
NSDefaultMallocZone(), GSUniTerminate) == NO)
|
||||
NSDefaultMallocZone(), GSUniTerminate | GSUniTemporary) == NO)
|
||||
{
|
||||
[NSException raise: NSCharacterConversionException
|
||||
format: @"Can't convert to/from Unicode string."];
|
||||
|
@ -249,7 +249,6 @@ drawRun(GSTextRun *run, NSPoint origin, GSDrawInfo *draw)
|
|||
(enc != NSUnicodeStringEncoding))
|
||||
{
|
||||
unsigned int size = 1;
|
||||
unsigned char c = 0;
|
||||
unsigned char *dst = buf;
|
||||
|
||||
GSFromUnicode(&dst, &size, &(run->glyphs[i].glyph), 1, enc, 0, 0);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue