Skip to content

Commit 6ba0654

Browse files
committed
Add call to iProvider.shutdown on application exit; Release 1.10.1
1 parent 7e794a6 commit 6ba0654

File tree

5 files changed

+22
-2
lines changed

5 files changed

+22
-2
lines changed

CHANGELOG.md

+2-1
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,11 @@ All notable changes to this project will be documented in this file.
44
The format is based on [Keep a Changelog](http://keepachangelog.com/)
55
and this project adheres to [Semantic Versioning](http://semver.org/).
66

7-
## [1.10.1] - Unreleased
7+
## [1.10.1] - 2023-12-21
88

99
### Fixed
1010

11+
- Call iProvider.shutdown() on program exit.
1112
- #33 - SIGABRT on interface detach.
1213

1314
## [1.10.0] - 2023-10-03

docs/changelog.txt

+6
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,12 @@
22
Changelog
33
#########
44

5+
Version 1.10.1
6+
==============
7+
8+
* Call iProvider.shutdown() on program exit.
9+
* Fix: #33 - SIGABRT on interface detach.
10+
511
Version 1.10.0
612
==============
713

pyproject.toml

+4
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,10 @@ cov-report = [
6565
"- coverage combine",
6666
"coverage report",
6767
]
68+
cov-html = [
69+
"- coverage combine",
70+
"coverage html",
71+
]
6872
cov = [
6973
"test-cov",
7074
"cov-report",

src/firebird/driver/__init__.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -61,4 +61,4 @@
6161
Server, Statement)
6262

6363
#: Current driver version, SEMVER string.
64-
__VERSION__ = '1.10.0'
64+
__VERSION__ = '1.10.1'

src/firebird/driver/core.py

+9
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@
5050
import struct
5151
import datetime
5252
import decimal
53+
import atexit
5354
from abc import ABC, abstractmethod
5455
from warnings import warn
5556
from pathlib import Path
@@ -150,6 +151,14 @@ def __api_loaded(api: a.FirebirdAPI) -> None:
150151

151152
add_hook(APIHook.LOADED, a.FirebirdAPI, __api_loaded)
152153

154+
@atexit.register
155+
def _api_shutdown():
156+
"""Calls a smart shutdown of various Firebird subsystems (yValve, engine, redirector).
157+
"""
158+
if _master is not None:
159+
with _master.get_dispatcher() as provider:
160+
provider.shutdown(0, -3) # fb_shutrsn_app_stopped
161+
153162
def _create_blob_buffer(size: int=MAX_BLOB_SEGMENT_SIZE) -> Any:
154163
if size < MAX_BLOB_SEGMENT_SIZE:
155164
result = getattr(_thns, 'blob_buf', None)

0 commit comments

Comments
 (0)