From 8a5a4ee5f0e5907d667ee00dae5f6817733f023c Mon Sep 17 00:00:00 2001 From: Sung-Jin Park Date: Wed, 19 Aug 2020 15:26:55 +0900 Subject: [PATCH] DSBuffer: initialize member varable, add null ptr check @ constructor Change-Id: I9c3a940533041424c38d72611947f63347175c64 Signed-off-by: Sung-Jin Park --- src/DSBuffer/DSBufferManager.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/DSBuffer/DSBufferManager.cpp b/src/DSBuffer/DSBufferManager.cpp index 8c96912..3c3cc14 100644 --- a/src/DSBuffer/DSBufferManager.cpp +++ b/src/DSBuffer/DSBufferManager.cpp @@ -114,7 +114,8 @@ std::shared_ptr DSBufferManager::getDSBuffer(struct ::wl_resource *bu DSBufferManagerPrivate::DSBufferManagerPrivate(DSBufferManager *p_ptr) : DSObjectPrivate(p_ptr), - __p_ptr(p_ptr) + __p_ptr(p_ptr), + __wlTbmServer(nullptr) { tbm_bufmgr bufmgr = nullptr; @@ -133,7 +134,7 @@ DSBufferManagerPrivate::DSBufferManagerPrivate(DSBufferManager *p_ptr) DSLOG_ERR("DSBufferManagerPrivate", "fail to get tbm_bufmgr"); } - if (bufmgr) + if (__waylandCompositor && bufmgr) tbm_bufmgr_bind_native_display(bufmgr, __waylandCompositor->display()); } -- 2.7.4