Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mapsme/omim.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/drape
diff options
context:
space:
mode:
authorr.kuznetsov <r.kuznetsov@corp.mail.ru>2016-04-06 12:53:19 +0300
committerAlex Zolotarev <alex@maps.me>2016-04-07 19:56:15 +0300
commitf8cbf10eea417bd96f83cd3f3f7f3d0950fe002e (patch)
treee27a24a72764f153994edcfba23972491fbfc592 /drape
parentf1a5f885c55573af608b10adb864d37e1b961a37 (diff)
Fixed crash on drape initialization in background
Diffstat (limited to 'drape')
-rw-r--r--drape/oglcontextfactory.cpp5
-rw-r--r--drape/oglcontextfactory.hpp7
2 files changed, 10 insertions, 2 deletions
diff --git a/drape/oglcontextfactory.cpp b/drape/oglcontextfactory.cpp
index 4408c4e01b..4d2d17d0b9 100644
--- a/drape/oglcontextfactory.cpp
+++ b/drape/oglcontextfactory.cpp
@@ -41,4 +41,9 @@ OGLContext * ThreadSafeFactory::CreateContext(TCreateCtxFn const & createFn, TIs
return ctx;
}
+void ThreadSafeFactory::waitForInitialization()
+{
+ m_factory->waitForInitialization();
+}
+
} // namespace dp
diff --git a/drape/oglcontextfactory.hpp b/drape/oglcontextfactory.hpp
index c015781843..f3cb2fe366 100644
--- a/drape/oglcontextfactory.hpp
+++ b/drape/oglcontextfactory.hpp
@@ -18,6 +18,7 @@ public:
virtual OGLContext * getResourcesUploadContext() = 0;
virtual bool isDrawContextCreated() const { return false; }
virtual bool isUploadContextCreated() const { return false; }
+ virtual void waitForInitialization() {}
};
class ThreadSafeFactory : public OGLContextFactory
@@ -25,8 +26,8 @@ class ThreadSafeFactory : public OGLContextFactory
public:
ThreadSafeFactory(OGLContextFactory * factory, bool enableSharing = true);
~ThreadSafeFactory();
- virtual OGLContext * getDrawContext();
- virtual OGLContext * getResourcesUploadContext();
+ OGLContext * getDrawContext() override;
+ OGLContext * getResourcesUploadContext() override;
template<typename T>
T * CastFactory()
@@ -35,6 +36,8 @@ public:
return static_cast<T *>(m_factory);
}
+ void waitForInitialization() override;
+
protected:
typedef function<OGLContext * ()> TCreateCtxFn;
typedef function<bool()> TIsSeparateCreatedFn;