diff --git a/CHANGELOG.md b/CHANGELOG.md index 1f333fd..fddbba6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,10 +4,11 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](http://keepachangelog.com/) and this project adheres to [Semantic Versioning](http://semver.org/). -## [1.10.1] - Unreleased +## [1.10.1] - 2023-12-21 ### Fixed +- Call iProvider.shutdown() on program exit. - #33 - SIGABRT on interface detach. ## [1.10.0] - 2023-10-03 diff --git a/docs/changelog.txt b/docs/changelog.txt index e9b0506..8791f4e 100644 --- a/docs/changelog.txt +++ b/docs/changelog.txt @@ -2,6 +2,12 @@ Changelog ######### +Version 1.10.1 +============== + +* Call iProvider.shutdown() on program exit. +* Fix: #33 - SIGABRT on interface detach. + Version 1.10.0 ============== diff --git a/pyproject.toml b/pyproject.toml index c57e644..9c0a3e7 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -65,6 +65,10 @@ cov-report = [ "- coverage combine", "coverage report", ] +cov-html = [ + "- coverage combine", + "coverage html", +] cov = [ "test-cov", "cov-report", diff --git a/src/firebird/driver/__init__.py b/src/firebird/driver/__init__.py index 144ce96..f44f6b7 100644 --- a/src/firebird/driver/__init__.py +++ b/src/firebird/driver/__init__.py @@ -61,4 +61,4 @@ Server, Statement) #: Current driver version, SEMVER string. -__VERSION__ = '1.10.0' +__VERSION__ = '1.10.1' diff --git a/src/firebird/driver/core.py b/src/firebird/driver/core.py index f49dc74..d6fca12 100644 --- a/src/firebird/driver/core.py +++ b/src/firebird/driver/core.py @@ -50,6 +50,7 @@ import struct import datetime import decimal +import atexit from abc import ABC, abstractmethod from warnings import warn from pathlib import Path @@ -150,6 +151,14 @@ def __api_loaded(api: a.FirebirdAPI) -> None: add_hook(APIHook.LOADED, a.FirebirdAPI, __api_loaded) +@atexit.register +def _api_shutdown(): + """Calls a smart shutdown of various Firebird subsystems (yValve, engine, redirector). + """ + if _master is not None: + with _master.get_dispatcher() as provider: + provider.shutdown(0, -3) # fb_shutrsn_app_stopped + def _create_blob_buffer(size: int=MAX_BLOB_SEGMENT_SIZE) -> Any: if size < MAX_BLOB_SEGMENT_SIZE: result = getattr(_thns, 'blob_buf', None)