dont destroy texture if handle is NULL

This commit is contained in:
Gregory Wells
2025-08-17 23:28:21 -04:00
parent 026fc52d7c
commit eb11649a03

View File

@@ -6,6 +6,7 @@ gnReturnCode gnCreateTexture(gnTexture* texture, gnDevice device, const gnTextur
*texture = malloc(sizeof(struct gnTexture_t)); *texture = malloc(sizeof(struct gnTexture_t));
(*texture)->device = device; (*texture)->device = device;
(*texture)->info = info; (*texture)->info = info;
return device->instance->callingLayer->deviceFunctions._gnCreateTexture(*texture, device, 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); texture->device->instance->callingLayer->deviceFunctions._gnTextureData(texture, pixelData);
} }
void gnDestroyTexture(gnTexture texture) { void gnDestroyTexture(gnTexture texture) {
if (texture == GN_NULL_HANDLE) return;
texture->device->instance->callingLayer->deviceFunctions._gnDestroyTexture(texture); texture->device->instance->callingLayer->deviceFunctions._gnDestroyTexture(texture);
} }