Allegro.cc - Online Community

Allegro.cc Forums » Programming Questions » my program shuts down unexpectedly.

This thread is locked; no one can reply to it. rss feed Print
my program shuts down unexpectedly.
Doctor Cop
Member #16,833
April 2018
avatar

I created a button in ALLEGRO5. But my program crashes after about 5 seconds if I move my cursor around the button few times.

I have attached my executable and program. please help

Audric
Member #907
January 2001

You are leaking memory like crazy, with those calls to al_load_font() in main.cpp and buttons.h.
You should load these fonts once, somehwere after al_init() al_init_ttf_addon(), and then you don't have to worry about it.

Doctor Cop
Member #16,833
April 2018
avatar

Thanks for your help.
It did helped me a lot now i have to find another way to modify font position but at least it is working good.

Thanks_again();

Go to: