sokol icon indicating copy to clipboard operation
sokol copied to clipboard

sokol_gfx.h: maybe make sg_destroy calls with an invalid handle an error.

Open floooh opened this issue 5 months ago • 0 comments

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.

floooh avatar Aug 17 '25 18:08 floooh