How to avoid memory leak with CTFontCreateWithGraphicsFont?
问题 I've reduced a leak issue to this easy to compile code which shows after CTFontCreateWithGraphicsFont use and release ct_font , an extra ref to cg_font will be left. Is this an internal Apple ref count issue or am I missing something around like having to double release cg_font or changing order of the releases? Thanks. #include <stdio.h> #include <stdlib.h> #include <ApplicationServices/ApplicationServices.h> int main(int argc, char **argv) { FILE *f = fopen("/Library/Fonts/Tahoma.ttf", "rb"