From 4430a356f44fb226c139bee5be591e2eb64b4f13 Mon Sep 17 00:00:00 2001 From: Chia-I Wu Date: Wed, 6 Aug 2014 12:08:44 +0800 Subject: icd: fix driver reinit without alloc cb --- icd/common/icd.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/icd/common/icd.c b/icd/common/icd.c index 0d279f8b..8750554a 100644 --- a/icd/common/icd.c +++ b/icd/common/icd.c @@ -220,6 +220,13 @@ ICD_EXPORT XGL_RESULT XGLAPI xglDbgSetGlobalOption(XGL_DBG_GLOBAL_OPTION dbgOpti XGL_RESULT icd_set_allocator(const XGL_ALLOC_CALLBACKS *alloc_cb) { if (icd.init_count) { + const XGL_ALLOC_CALLBACKS default_cb = { + NULL, default_alloc, default_free + }; + + if (!alloc_cb) + alloc_cb = &default_cb; + /* * The spec says: Changing the callbacks on subsequent calls to * xglInitAndEnumerateGpus() causes it to fail with -- cgit v1.2.3