[core] Add noexcept(false) in MBGL_CHECK_ERROR
C++11 destructors are noexcept by default, so the prior definition always called std::terminate without allowing anything to catch the exception.
This commit is contained in:
@@ -41,7 +41,7 @@ struct Error : std::runtime_error {
|
||||
void checkError(const char *cmd, const char *file, int line);
|
||||
|
||||
#ifndef NDEBUG
|
||||
#define MBGL_CHECK_ERROR(cmd) ([&]() { struct __MBGL_C_E { ~__MBGL_C_E() { ::mbgl::gl::checkError(#cmd, __FILE__, __LINE__); } } __MBGL_C_E; return cmd; }())
|
||||
#define MBGL_CHECK_ERROR(cmd) ([&]() { struct __MBGL_C_E { ~__MBGL_C_E() noexcept(false) { ::mbgl::gl::checkError(#cmd, __FILE__, __LINE__); } } __MBGL_C_E; return cmd; }())
|
||||
#else
|
||||
#define MBGL_CHECK_ERROR(cmd) (cmd)
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user