trace: Check for destroy before calling it
authorJakob Bornecrantz <jakob@vmware.com>
Tue, 20 Oct 2009 15:17:41 +0000 (17:17 +0200)
committerJakob Bornecrantz <jakob@vmware.com>
Tue, 20 Oct 2009 15:19:05 +0000 (17:19 +0200)
src/gallium/drivers/trace/tr_drm.c

index 781ca5d3bc0cbc9c7eb8d960915fd987f85bd791..48d1c4051cc274a258b96be292da2b1ba13a0a55 100644 (file)
@@ -150,7 +150,9 @@ trace_drm_destroy(struct drm_api *_api)
 {
    struct trace_drm_api *tr_api = trace_drm_api(_api);
    struct drm_api *api = tr_api->api;
-   api->destroy(api);
+
+   if (api->destroy)
+      api->destroy(api);
 
    free(tr_api);
 }