gtTkCommon.c: SUPPORT_DIRECT_MALLOC around function pointer use of legacy malloc

Just in case I also modify the allocation to ensure it was also performed
via exactly the same method.
This commit is contained in:
Darryl L. Miles 2025-02-13 08:19:19 +00:00
parent f173c0ebda
commit 6022eead50
1 changed files with 9 additions and 1 deletions

View File

@ -209,9 +209,17 @@ grTkDefineCursor(glyphs)
return;
}
#ifdef SUPPORT_DIRECT_MALLOC
glyphcache = (CursorCache *)malloc(sizeof(CursorCache));
#else
glyphcache = (CursorCache *)mallocMagic(sizeof(CursorCache));
#endif
g->gr_cache = (ClientData)glyphcache;
g->gr_free = freeMagic;
#ifdef SUPPORT_DIRECT_MALLOC
g->gr_free = free;
#else
g->gr_free = freeMagicLegacy;
#endif
/* Find the foreground and background colors of the glyph */