On Sun, 13 Nov 2016 09:07:01 +0100 (CET) Werner LEMBERG <[email protected]> wrote:
> >> And indeed, you have forgotten to set a proper size (with > >> `FT_Set_Char_Size', for example) before calling `FT_Load_Glyph'. > > > > Thank you, it works now but I have some memory leaks (74 allocs, 68 > > frees). [...] > > Please make your homework first: > > > ==1477== Rerun with --leak-check=full to see details of leaked > > memory > > If you try that you get more information that should help you identify > the problem. > Here is the result with --leak-check=full: --- $ valgrind --leak-check=full ./a.out ==1236== Memcheck, a memory error detector ==1236== Copyright (C) 2002-2015, and GNU GPL'd, by Julian Seward et al. ==1236== Using Valgrind-3.11.0 and LibVEX; rerun with -h for copyright info ==1236== Command: ./a.out ==1236== ==1236== ==1236== HEAP SUMMARY: ==1236== in use at exit: 18,604 bytes in 6 blocks ==1236== total heap usage: 74 allocs, 68 frees, 53,175 bytes allocated ==1236== ==1236== LEAK SUMMARY: ==1236== definitely lost: 0 bytes in 0 blocks ==1236== indirectly lost: 0 bytes in 0 blocks ==1236== possibly lost: 0 bytes in 0 blocks ==1236== still reachable: 18,604 bytes in 6 blocks ==1236== suppressed: 0 bytes in 0 blocks ==1236== Reachable blocks (those to which a pointer was found) are not shown. ==1236== To see them, rerun with: --leak-check=full --show-leak-kinds=all ==1236== ==1236== For counts of detected and suppressed errors, rerun with: -v ==1236== ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 0 from 0) --- And now with --leak-check=full and --show-leak-kinds=all: --- $ valgrind --leak-check=full --show-leak-kinds=all ./a.out ==1240== Memcheck, a memory error detector ==1240== Copyright (C) 2002-2015, and GNU GPL'd, by Julian Seward et al. ==1240== Using Valgrind-3.11.0 and LibVEX; rerun with -h for copyright info ==1240== Command: ./a.out ==1240== ==1240== ==1240== HEAP SUMMARY: ==1240== in use at exit: 18,604 bytes in 6 blocks ==1240== total heap usage: 74 allocs, 68 frees, 53,175 bytes allocated ==1240== ==1240== 4 bytes in 1 blocks are still reachable in loss record 1 of 6 ==1240== at 0x4C2CB7F: malloc (vg_replace_malloc.c:299) ==1240== by 0x57A8E82: g_private_impl_new (in /usr/lib64/libglib-2.0.so.0.5000.0) ==1240== by 0x57A93A4: g_private_get (in /usr/lib64/libglib-2.0.so.0.5000.0) ==1240== by 0x57821EC: g_slice_alloc (in /usr/lib64/libglib-2.0.so.0.5000.0) ==1240== by 0x5753B1D: g_hash_table_new_full (in /usr/lib64/libglib-2.0.so.0.5000.0) ==1240== by 0x57755EA: g_quark_init (in /usr/lib64/libglib-2.0.so.0.5000.0) ==1240== by 0x4010339: call_init.part.0 (in /lib64/ld-2.23.so) ==1240== by 0x401044A: _dl_init (in /lib64/ld-2.23.so) ==1240== by 0x4000C99: ??? (in /lib64/ld-2.23.so) ==1240== ==1240== 32 bytes in 1 blocks are still reachable in loss record 2 of 6 ==1240== at 0x4C2EB45: calloc (vg_replace_malloc.c:711) ==1240== by 0x576A2C0: g_malloc0 (in /usr/lib64/libglib-2.0.so.0.5000.0) ==1240== by 0x5753B84: g_hash_table_new_full (in /usr/lib64/libglib-2.0.so.0.5000.0) ==1240== by 0x57755EA: g_quark_init (in /usr/lib64/libglib-2.0.so.0.5000.0) ==1240== by 0x4010339: call_init.part.0 (in /lib64/ld-2.23.so) ==1240== by 0x401044A: _dl_init (in /lib64/ld-2.23.so) ==1240== by 0x4000C99: ??? (in /lib64/ld-2.23.so) ==1240== ==1240== 64 bytes in 1 blocks are still reachable in loss record 3 of 6 ==1240== at 0x4C2EB45: calloc (vg_replace_malloc.c:711) ==1240== by 0x576A2C0: g_malloc0 (in /usr/lib64/libglib-2.0.so.0.5000.0) ==1240== by 0x5753B6F: g_hash_table_new_full (in /usr/lib64/libglib-2.0.so.0.5000.0) ==1240== by 0x57755EA: g_quark_init (in /usr/lib64/libglib-2.0.so.0.5000.0) ==1240== by 0x4010339: call_init.part.0 (in /lib64/ld-2.23.so) ==1240== by 0x401044A: _dl_init (in /lib64/ld-2.23.so) ==1240== by 0x4000C99: ??? (in /lib64/ld-2.23.so) ==1240== ==1240== 88 bytes in 1 blocks are still reachable in loss record 4 of 6 ==1240== at 0x4C2CB7F: malloc (vg_replace_malloc.c:299) ==1240== by 0x576A268: g_malloc (in /usr/lib64/libglib-2.0.so.0.5000.0) ==1240== by 0x5782212: g_slice_alloc (in /usr/lib64/libglib-2.0.so.0.5000.0) ==1240== by 0x5753B1D: g_hash_table_new_full (in /usr/lib64/libglib-2.0.so.0.5000.0) ==1240== by 0x57755EA: g_quark_init (in /usr/lib64/libglib-2.0.so.0.5000.0) ==1240== by 0x4010339: call_init.part.0 (in /lib64/ld-2.23.so) ==1240== by 0x401044A: _dl_init (in /lib64/ld-2.23.so) ==1240== by 0x4000C99: ??? (in /lib64/ld-2.23.so) ==1240== ==1240== 2,032 bytes in 1 blocks are still reachable in loss record 5 of 6 ==1240== at 0x4C2EB45: calloc (vg_replace_malloc.c:711) ==1240== by 0x576A2C0: g_malloc0 (in /usr/lib64/libglib-2.0.so.0.5000.0) ==1240== by 0x578247B: g_slice_alloc (in /usr/lib64/libglib-2.0.so.0.5000.0) ==1240== by 0x5753B1D: g_hash_table_new_full (in /usr/lib64/libglib-2.0.so.0.5000.0) ==1240== by 0x57755EA: g_quark_init (in /usr/lib64/libglib-2.0.so.0.5000.0) ==1240== by 0x4010339: call_init.part.0 (in /lib64/ld-2.23.so) ==1240== by 0x401044A: _dl_init (in /lib64/ld-2.23.so) ==1240== by 0x4000C99: ??? (in /lib64/ld-2.23.so) ==1240== ==1240== 16,384 bytes in 1 blocks are still reachable in loss record 6 of 6 ==1240== at 0x4C2CB7F: malloc (vg_replace_malloc.c:299) ==1240== by 0x576A268: g_malloc (in /usr/lib64/libglib-2.0.so.0.5000.0) ==1240== by 0x57755FB: g_quark_init (in /usr/lib64/libglib-2.0.so.0.5000.0) ==1240== by 0x4010339: call_init.part.0 (in /lib64/ld-2.23.so) ==1240== by 0x401044A: _dl_init (in /lib64/ld-2.23.so) ==1240== by 0x4000C99: ??? (in /lib64/ld-2.23.so) ==1240== ==1240== LEAK SUMMARY: ==1240== definitely lost: 0 bytes in 0 blocks ==1240== indirectly lost: 0 bytes in 0 blocks ==1240== possibly lost: 0 bytes in 0 blocks ==1240== still reachable: 18,604 bytes in 6 blocks ==1240== suppressed: 0 bytes in 0 blocks ==1240== ==1240== For counts of detected and suppressed errors, rerun with: -v ==1240== ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 0 from 0) --- _______________________________________________ Freetype mailing list [email protected] https://lists.nongnu.org/mailman/listinfo/freetype
