Commit 68529e33 authored by Ronan Abhamon's avatar Ronan Abhamon

feat(src/components/camera/MSFunctions): fortify asserts

parent fedf0cae
...@@ -4,11 +4,11 @@ ...@@ -4,11 +4,11 @@
#include <QOpenGLFunctions> #include <QOpenGLFunctions>
#define GL_CALL(CALL) \ #define GL_CALL(CALL) \
Q_ASSERT(QOpenGLContext::currentContext()->functions() == m_instance->m_q_functions); \ Q_ASSERT(QOpenGLContext::currentContext()->functions() == m_instance->m_q_functions && m_instance->m_q_functions != NULL); \
m_instance->m_q_functions->CALL; m_instance->m_q_functions->CALL;
#define GL_CALL_RET(CALL) \ #define GL_CALL_RET(CALL) \
Q_ASSERT(QOpenGLContext::currentContext()->functions() == m_instance->m_q_functions); \ Q_ASSERT(QOpenGLContext::currentContext()->functions() == m_instance->m_q_functions && m_instance->m_q_functions != NULL); \
return m_instance->m_q_functions->CALL; return m_instance->m_q_functions->CALL;
// ============================================================================= // =============================================================================
...@@ -193,4 +193,7 @@ private: ...@@ -193,4 +193,7 @@ private:
static MSFunctions *m_instance; static MSFunctions *m_instance;
}; };
#undef GL_CALL
#undef GL_CALL_RET
#endif // MS_FUNCTIONS_H_ #endif // MS_FUNCTIONS_H_
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment