aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChia-I Wu <olvaffe@gmail.com>2014-08-06 12:08:44 +0800
committerChia-I Wu <olvaffe@gmail.com>2014-08-06 12:08:57 +0800
commit4430a356f44fb226c139bee5be591e2eb64b4f13 (patch)
treeb487d8c80980ddcc82b1534afb395cf19c7987f7
parentbe1042ead50b3a50f1acb4131c5246770f418813 (diff)
downloadusermoji-4430a356f44fb226c139bee5be591e2eb64b4f13.tar.xz
icd: fix driver reinit without alloc cb
-rw-r--r--icd/common/icd.c7
1 files changed, 7 insertions, 0 deletions
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