|
al_shutdown_video_addon invalid read & free |
huguesdpdn
Member #16,616
January 2017
|
Hello, I am really enjoying this new graphic library, but still detect a problem with al_shutdown_video_addon(). This is what I get when I use or not functions relatives to al_shutdown_video_addon . ==6982== Invalid read of size 8 So I check al_init_video_addon function source code to try to understand why this is happening, and maybe this can help : In add_handler (video.c, line 73) called by al_init_video_addon, Thanks to Allegro Team |
SiegeLord
Member #7,827
October 2006
|
Nah, that struct is allocated via al_calloc which zeroes the memory out. The issue is that al_shutdown_video_addon is called twice, once by you explicitly (which works fine) but then a second time by Allegro's destructor system which gets invoked when the main function exits (see your backtrace). In principle you could remove your explicit call to al_shutdown_video_addon and things will work fine. Either way, this is now fixed on the master branch: https://github.com/liballeg/allegro5/commit/6471441. Thanks for reporting this! "For in much wisdom is much grief: and he that increases knowledge increases sorrow."-Ecclesiastes 1:18 |
Neil Roy
Member #2,229
April 2002
|
Not sure why you would call al_shutdown_video_addon() manually when the documentation clearly states it is shut down automatically. --- |
huguesdpdn
Member #16,616
January 2017
|
@SiegeLord : I was thought there was something like this with a bzero or memset behind, but I didn't check the al_calloc function. Thank you for the new release! Hope coming soon @Neil Roy: Thanks both of you. |
|