diff options
| author | snowman2 <alansnow21@gmail.com> | 2020-08-16 19:40:00 -0500 |
|---|---|---|
| committer | snowman2 <alansnow21@gmail.com> | 2020-08-19 08:06:18 -0500 |
| commit | 8c41cfc3a714c532183a0c3542f86609ea1bc8ac (patch) | |
| tree | abc36ab0c95a5daa57bdd319764e7f7b728f9cfa /src/filemanager.cpp | |
| parent | 84713021edf688c9cf157562d34388583325aa45 (diff) | |
| download | PROJ-8c41cfc3a714c532183a0c3542f86609ea1bc8ac.tar.gz PROJ-8c41cfc3a714c532183a0c3542f86609ea1bc8ac.zip | |
Add methods to ensure safer interactions with cpp_context
Diffstat (limited to 'src/filemanager.cpp')
| -rw-r--r-- | src/filemanager.cpp | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/src/filemanager.cpp b/src/filemanager.cpp index 29e85fbc..db0aa2ee 100644 --- a/src/filemanager.cpp +++ b/src/filemanager.cpp @@ -1627,10 +1627,7 @@ static void *pj_open_file_with_manager(projCtx ctx, const char *name, static NS_PROJ::io::DatabaseContextPtr getDBcontext(PJ_CONTEXT *ctx) { try { - if (ctx->cpp_context == nullptr) { - ctx->cpp_context = new projCppContext(ctx); - } - return ctx->cpp_context->getDatabaseContext().as_nullable(); + return ctx->get_cpp_context()->getDatabaseContext().as_nullable(); } catch (const std::exception &e) { pj_log(ctx, PJ_LOG_DEBUG, "%s", e.what()); return nullptr; |
