From eb11649a03f7a0d2b6d69b246523c15fdbce78d6 Mon Sep 17 00:00:00 2001 From: Gregory Wells Date: Sun, 17 Aug 2025 23:28:21 -0400 Subject: [PATCH] dont destroy texture if handle is NULL --- projects/core/src/textures/gryphn_texture.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/projects/core/src/textures/gryphn_texture.c b/projects/core/src/textures/gryphn_texture.c index 5258778..96b49b4 100644 --- a/projects/core/src/textures/gryphn_texture.c +++ b/projects/core/src/textures/gryphn_texture.c @@ -6,6 +6,7 @@ gnReturnCode gnCreateTexture(gnTexture* texture, gnDevice device, const gnTextur *texture = malloc(sizeof(struct gnTexture_t)); (*texture)->device = device; (*texture)->info = info; + return device->instance->callingLayer->deviceFunctions._gnCreateTexture(*texture, device, info); } @@ -13,5 +14,6 @@ void gnTextureData(gnTextureHandle texture, void* pixelData) { texture->device->instance->callingLayer->deviceFunctions._gnTextureData(texture, pixelData); } void gnDestroyTexture(gnTexture texture) { + if (texture == GN_NULL_HANDLE) return; texture->device->instance->callingLayer->deviceFunctions._gnDestroyTexture(texture); }