diff options
author | Konstantin Käfer <mail@kkaefer.com> | 2015-12-01 23:08:40 +0100 |
---|---|---|
committer | Konstantin Käfer <mail@kkaefer.com> | 2015-12-03 15:38:36 +0100 |
commit | c279fb171700c464c1cdac5cd2da39f142274d8d (patch) | |
tree | 1cd300b174ba13df6869b3c8bd591f07f0d66582 /src | |
parent | 0c351eb523d80fa534bd239b6d5e677e3d5635bb (diff) | |
download | qtlocation-mapboxgl-c279fb171700c464c1cdac5cd2da39f142274d8d.tar.gz |
[core] throw values, catch references
Diffstat (limited to 'src')
-rw-r--r-- | src/mbgl/geometry/buffer.hpp | 2 | ||||
-rw-r--r-- | src/mbgl/util/thread_context.cpp | 4 | ||||
-rw-r--r-- | src/mbgl/util/thread_local.hpp | 6 |
3 files changed, 6 insertions, 6 deletions
diff --git a/src/mbgl/geometry/buffer.hpp b/src/mbgl/geometry/buffer.hpp index 18bf05911a..c7278a1036 100644 --- a/src/mbgl/geometry/buffer.hpp +++ b/src/mbgl/geometry/buffer.hpp @@ -99,7 +99,7 @@ protected: } if (i * itemSize >= pos) { - throw new std::runtime_error("Can't get element after array bounds"); + throw std::runtime_error("Can't get element after array bounds"); } else { return reinterpret_cast<char *>(array) + (i * itemSize); } diff --git a/src/mbgl/util/thread_context.cpp b/src/mbgl/util/thread_context.cpp index fba5207390..b611b3d023 100644 --- a/src/mbgl/util/thread_context.cpp +++ b/src/mbgl/util/thread_context.cpp @@ -56,7 +56,7 @@ void ThreadContext::setFileSource(FileSource* fileSource) { if (current.get() != nullptr) { current.get()->fileSource = fileSource; } else { - throw new std::runtime_error("Current thread has no current ThreadContext."); + throw std::runtime_error("Current thread has no current ThreadContext."); } } @@ -72,7 +72,7 @@ void ThreadContext::setGLObjectStore(GLObjectStore* glObjectStore) { if (current.get() != nullptr) { current.get()->glObjectStore = glObjectStore; } else { - throw new std::runtime_error("Current thread has no current ThreadContext."); + throw std::runtime_error("Current thread has no current ThreadContext."); } } diff --git a/src/mbgl/util/thread_local.hpp b/src/mbgl/util/thread_local.hpp index c805735cc4..5405037358 100644 --- a/src/mbgl/util/thread_local.hpp +++ b/src/mbgl/util/thread_local.hpp @@ -24,13 +24,13 @@ public: }); if (ret) { - throw new std::runtime_error("Failed to init local storage key."); + throw std::runtime_error("Failed to init local storage key."); } } inline ~ThreadLocal() { if (pthread_key_delete(key)) { - throw new std::runtime_error("Failed to delete local storage key."); + throw std::runtime_error("Failed to delete local storage key."); } } @@ -45,7 +45,7 @@ public: inline void set(T* ptr) { if (pthread_setspecific(key, ptr)) { - throw new std::runtime_error("Failed to set local storage."); + throw std::runtime_error("Failed to set local storage."); } } |