dont destroy texture if handle is NULL
This commit is contained in:
@@ -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);
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user