提交 930e8710 编写于 作者: zhdguy's avatar zhdguy

Render: fixed codestyle check bugs

The pointer of get() should check null or not.
上级 9ea3e8e6
......@@ -107,7 +107,7 @@ static EGLint rcGetGLString(EGLenum name, void* buffer, EGLint bufferSize) {
str = reinterpret_cast<const char*>(s_gles2.glGetString(name));
else {
str = reinterpret_cast<const char*>(s_gles1.glGetString(name));
if ((long int)str == name) {
if ((intptr_t)str == name) {
str = nullptr;
}
}
......
......@@ -376,6 +376,9 @@ HandleType Renderer::createColorBuffer(int p_width, int p_height,
m_colorbuffers[ret].refcount = 1;
RenderThreadInfo *tInfo = RenderThreadInfo::get();
if (!tInfo) {
return -1;
}
int tid = tInfo->m_tid;
if (tid > 0) {
m_procOwnedColorBuffers[tid].insert(ret);
......@@ -553,6 +556,9 @@ void Renderer::closeColorBuffer(HandleType p_colorbuffer)
std::unique_lock<std::mutex> l(m_lock);
closeColorBufferLocked(p_colorbuffer);
RenderThreadInfo *tInfo = RenderThreadInfo::get();
if (!tInfo) {
return;
}
int tid = tInfo->m_tid;
if (tid > 0) {
auto ite = m_procOwnedColorBuffers.find(tid);
......@@ -810,6 +816,9 @@ HandleType Renderer::createClientImage(HandleType context, EGLenum target,
HandleType imgHnd = static_cast<HandleType>(reinterpret_cast<uintptr_t>(image));
RenderThreadInfo *tInfo = RenderThreadInfo::get();
if (!tInfo) {
return false;
}
int tid = tInfo->m_tid;
if (tid > 0) {
std::unique_lock<std::mutex> l(m_lock);
......@@ -823,6 +832,9 @@ EGLBoolean Renderer::destroyClientImage(HandleType image) {
reinterpret_cast<EGLImageKHR>(image));
if (!ret) return false;
RenderThreadInfo *tInfo = RenderThreadInfo::get();
if (!tInfo) {
return false;
}
int tid = tInfo->m_tid;
if (tid > 0) {
std::unique_lock<std::mutex> l(m_lock);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册