use a reinterpret_cast to return the correct type
This commit is contained in:
committed by
Konstantin Käfer
parent
d62bf415f0
commit
8408dc9e4d
@@ -61,7 +61,7 @@ public:
|
||||
template<typename T, typename ...Args>
|
||||
static inline const T &Set(Args&& ...args) {
|
||||
Backend = util::make_unique<T>(::std::forward<Args>(args)...);
|
||||
return *dynamic_cast<T *>(Backend.get());
|
||||
return *reinterpret_cast<T *>(Backend.get());
|
||||
}
|
||||
|
||||
private:
|
||||
|
||||
@@ -127,7 +127,7 @@ bool Shader::compileShader(GLuint *shader, GLenum type, const GLchar *source) {
|
||||
|
||||
MBGL_CHECK_ERROR(glGetShaderiv(*shader, GL_COMPILE_STATUS, &status));
|
||||
if (status == GL_FALSE) {
|
||||
Log::Error(Event::Shader, "Shader %s failed to compile.", name, type);
|
||||
Log::Error(Event::Shader, "Shader %s failed to compile.", name);
|
||||
MBGL_CHECK_ERROR(glDeleteShader(*shader));
|
||||
*shader = 0;
|
||||
return false;
|
||||
|
||||
Reference in New Issue
Block a user