Skip to content

Commit

Permalink
fix new context state manager
Browse files Browse the repository at this point in the history
  • Loading branch information
Maxxen committed Aug 2, 2024
1 parent 51b4b14 commit 8c9dd58
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions spatial/src/spatial/gdal/file_handler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -385,10 +385,9 @@ string GDALClientContextState::GetPrefix(const string &value) const {
}

GDALClientContextState &GDALClientContextState::GetOrCreate(ClientContext &context) {
if (!context.registered_state["gdal"]) {
context.registered_state["gdal"] = make_uniq<GDALClientContextState>(context);
}
return *dynamic_cast<GDALClientContextState *>(context.registered_state["gdal"].get());
auto &manager = *context.registered_state;
auto state = manager.GetOrCreate<GDALClientContextState>("gdal", context);
return state->Cast<GDALClientContextState>();
}

} // namespace gdal
Expand Down

0 comments on commit 8c9dd58

Please sign in to comment.