st/egl: Check for null destroy callback on api struct
authorJakob Bornecrantz <wallbraker@gmail.com>
Tue, 20 Apr 2010 22:44:40 +0000 (23:44 +0100)
committerJakob Bornecrantz <wallbraker@gmail.com>
Tue, 20 Apr 2010 22:53:58 +0000 (23:53 +0100)
src/gallium/state_trackers/egl/kms/native_kms.c

index 860657349bc6d190ba89b3211ce63c67e35a4055..79645865f3b2dd69e0f5de3e4d117280783595ce 100644 (file)
@@ -680,7 +680,7 @@ kms_display_destroy(struct native_display *ndpy)
    if (kdpy->fd >= 0)
       drmClose(kdpy->fd);
 
-   if (kdpy->api)
+   if (kdpy->api && kdpy->api->destroy)
       kdpy->api->destroy(kdpy->api);
    FREE(kdpy);
 }