The manual doesn't say if the ALLEGRO_CONFIG returned by al_get_system_config should be destroyed or not.
Yes. al_get_system_config() returns a newly allocated piece of data, it's up to you to release it when you don't need it anymore.
No.
ALLEGRO_CONFIG *al_get_system_config(void) { return (active_sysdrv) ? active_sysdrv->config : NULL; }
Yes. al_get_system_config() returns a newly allocated piece of data, it's up to you to release it when you don't need it anymore.
Gets tend not to work that way. Typically "create" or "new" type functions you pair up with "destroy" or "delete" functions, where as with a "get" you just leave it be. Not everyone follows that pattern, but its pretty common.
I just made a note of this in bf960470dc.
Woops sorry. Seeing how the returned pointer was not const, I didn't think this would give direct access.
Seeing how the returned pointer was not const, I didn't think this would give direct access.
It's a pointer. You can always directly access the memory it points at.