made better checks when shutting down graphics subsystem

This commit is contained in:
jp9000 2013-10-02 23:13:26 -07:00
parent b3b19d8216
commit 817044721b

View File

@ -126,12 +126,15 @@ void gs_destroy(graphics_t graphics)
if (!graphics)
return;
if (graphics->module) {
if (graphics->sprite_buffer)
graphics->exports.vertexbuffer_destroy(graphics->sprite_buffer);
if (graphics->immediate_vertbuffer)
graphics->exports.vertexbuffer_destroy(
graphics->immediate_vertbuffer);
if (graphics->device)
graphics->exports.device_destroy(graphics->device);
}
da_free(graphics->matrix_stack);
da_free(graphics->viewport_stack);