Valgrind内存测试错误C.

时间:2016-05-17 08:55:11

标签: c valgrind

执行程序后释放内存有问题。看到某人,问题出在哪里?我认为我释放了所有东西,我以前分配的东西。谢谢。 这是我的代码:

    ==1949== Memcheck, a memory error detector
==1949== Copyright (C) 2002-2011, and GNU GPL'd, by Julian Seward et al.
==1949== Using Valgrind-3.7.0 and LibVEX; rerun with -h for copyright info
==1949== Command: ./s_main_o
==1949== 
==1949== 
==1949== HEAP SUMMARY:
==1949==     in use at exit: 100 bytes in 5 blocks
==1949==   total heap usage: 15 allocs, 10 frees, 332 bytes allocated
==1949== 
==1949== 100 bytes in 5 blocks are definitely lost in loss record 1 of 1
==1949==    at 0x4C272B8: calloc (vg_replace_malloc.c:566)
==1949==    by 0x400848: main (main.c:55)
==1949== 
==1949== LEAK SUMMARY:
==1949==    definitely lost: 100 bytes in 5 blocks
==1949==    indirectly lost: 0 bytes in 0 blocks
==1949==      possibly lost: 0 bytes in 0 blocks
==1949==    still reachable: 0 bytes in 0 blocks
==1949==         suppressed: 0 bytes in 0 blocks
==1949== 
==1949== For counts of detected and suppressed errors, rerun with: -v
==1949== ERROR SUMMARY: 1 errors from 1 contexts (suppressed: 4 from 4)

下面有valgrind日志:

    QList<QColor> colors = {
    QColor(0, 255, 255, 255),
    QColor(0, 200, 255, 255),
    QColor(0, 170, 255, 255),
    QColor(0, 150, 255, 255),
    QColor(0, 130, 255, 255),
};

该程序计算细胞自动机。 输入例如:2 30 5 0 0 1 0 0

0 个答案:

没有答案