Я пытаюсь написать простую игру с библиотекой allegro.cc, и вначале у меня обнаруживаются утечки памяти в valgrind.Может ли кто-нибудь сказать мне, что я не так?Я не верю, что у аллегро есть утечки памяти.Код:
#include <stdio.h>
#include <stdlib.h>
#include <allegro5/allegro.h>
int main(int argc, char** argv)
{
printf("start\n");
if (!al_init())
exit(EXIT_FAILURE);
ALLEGRO_DISPLAY *display = al_create_display(100, 100);
if (display == NULL)
exit(EXIT_FAILURE);
al_destroy_display(display);
al_uninstall_system();
return EXIT_SUCCESS;
}
Я запускаю его в Linux Ubuntu 16.04.
Команда для компиляции кода: gcc -Wall test.c -o test.o $(pkg-config --libs allegro-5)
Команда для запуска valgrind: valgrind --leak-check=full --show-leak-kinds=all --track-origins=yes ./test.o
Журналы Valgrind:
LEAK SUMMARY:
==28629== definitely lost: 88 bytes in 2 blocks
==28629== indirectly lost: 2,668 bytes in 10 blocks
==28629== possibly lost: 0 bytes in 0 blocks
==28629== still reachable: 121,860 bytes in 675 blocks
==28629== suppressed: 0 bytes in 0 blocks
==28629== Reachable blocks (those to which a pointer was found) are not shown.
==28629== To see them, rerun with: --leak-check=full --show-leak-kinds=all
==28629==
==28629== For counts of detected and suppressed errors, rerun with: -v
==28629== ERROR SUMMARY: 388 errors from 325 contexts (suppressed: 0 from 0)