summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorKonstantin Käfer <mail@kkaefer.com>2015-04-08 16:48:58 +0200
committerKonstantin Käfer <mail@kkaefer.com>2015-04-08 16:48:58 +0200
commitb47ebba2b902ee77f510b493ff281b609d65bd35 (patch)
treec85aca061d98932f5e8c7d442afad0f016936143 /include
parent7811acef217ebaf603512d705babe461ed3a43fb (diff)
parent59bd300b4356cb8cee396032e8eb8324376fb630 (diff)
downloadqtlocation-mapboxgl-b47ebba2b902ee77f510b493ff281b609d65bd35.tar.gz
Merge pull request #1071 from mapbox/1071-sqlite-avoid-crash
Gracefully handle SQLite errors
Diffstat (limited to 'include')
-rw-r--r--include/mbgl/platform/log.hpp4
-rw-r--r--include/mbgl/storage/default/sqlite_cache.hpp2
2 files changed, 5 insertions, 1 deletions
diff --git a/include/mbgl/platform/log.hpp b/include/mbgl/platform/log.hpp
index 5d287eb572..d6f3cd1ab4 100644
--- a/include/mbgl/platform/log.hpp
+++ b/include/mbgl/platform/log.hpp
@@ -4,6 +4,7 @@
#include <mbgl/platform/event.hpp>
#include <mbgl/util/std.hpp>
+#include <mbgl/util/noncopyable.hpp>
#include <memory>
#include <string>
@@ -12,7 +13,7 @@ namespace mbgl {
class Log {
public:
- class Observer {
+ class Observer : private util::noncopyable {
public:
virtual ~Observer() = default;
@@ -22,6 +23,7 @@ public:
};
static void setObserver(std::unique_ptr<Observer> Observer);
+ static std::unique_ptr<Observer> removeObserver();
private:
template <typename T, size_t N>
diff --git a/include/mbgl/storage/default/sqlite_cache.hpp b/include/mbgl/storage/default/sqlite_cache.hpp
index 8f2746561c..fe80a41b52 100644
--- a/include/mbgl/storage/default/sqlite_cache.hpp
+++ b/include/mbgl/storage/default/sqlite_cache.hpp
@@ -38,6 +38,7 @@ private:
void process(StopAction &action);
void createDatabase();
+ void createSchema();
const std::string path;
uv_loop_t *loop = nullptr;
@@ -45,6 +46,7 @@ private:
std::thread thread;
std::unique_ptr<::mapbox::sqlite::Database> db;
std::unique_ptr<::mapbox::sqlite::Statement> getStmt, putStmt, refreshStmt;
+ bool schema = false;
};
}