sokol
sokol copied to clipboard
sokol_gfx.h: maybe make sg_destroy calls with an invalid handle an error.
With the view update there's the following 'loophole' when destroying a view and its associated image:
sg_destroy_view(view);
sg_destroy_image(sg_query_view_image(view));
The sg_destroy_image call will be a silent no-op because sg_query_view_image() returns an invalid handle.
Maybe at least log an error or warning when the sg_destroy_* funcs are called with an SG_INVALID_ID handle. This dials back some of the 'convenience' but might at least avoid a resource leak.