\brief Stops an insertion session started with * proj_insert_object_session_create() * * @param ctx PROJ context, or NULL for default context * @param session The insertion session. * @since 8.1 */
| 9447 | * @since 8.1 |
| 9448 | */ |
| 9449 | void proj_insert_object_session_destroy(PJ_CONTEXT *ctx, |
| 9450 | PJ_INSERT_SESSION *session) { |
| 9451 | SANITIZE_CTX(ctx); |
| 9452 | if (session) { |
| 9453 | try { |
| 9454 | if (session->ctx != ctx) { |
| 9455 | proj_log_error(ctx, __FUNCTION__, |
| 9456 | "proj_insert_object_session_destroy() called " |
| 9457 | "with a context different from the one of " |
| 9458 | "proj_insert_object_session_create()"); |
| 9459 | } else { |
| 9460 | auto dbContext = getDBcontext(ctx); |
| 9461 | dbContext->stopInsertStatementsSession(); |
| 9462 | } |
| 9463 | } catch (const std::exception &e) { |
| 9464 | proj_log_error(ctx, __FUNCTION__, e.what()); |
| 9465 | } |
| 9466 | delete session; |
| 9467 | } |
| 9468 | } |
| 9469 | |
| 9470 | // --------------------------------------------------------------------------- |
| 9471 |