Skip to content

Commit

Permalink
Add call to iProvider.shutdown on application exit; Release 1.10.1
Browse files Browse the repository at this point in the history
  • Loading branch information
pcisar committed Dec 21, 2023
1 parent 7e794a6 commit 6ba0654
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 2 deletions.
3 changes: 2 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 6 additions & 0 deletions docs/changelog.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
==============

Expand Down
4 changes: 4 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,10 @@ cov-report = [
"- coverage combine",
"coverage report",
]
cov-html = [
"- coverage combine",
"coverage html",
]
cov = [
"test-cov",
"cov-report",
Expand Down
2 changes: 1 addition & 1 deletion src/firebird/driver/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,4 +61,4 @@
Server, Statement)

#: Current driver version, SEMVER string.
__VERSION__ = '1.10.0'
__VERSION__ = '1.10.1'
9 changes: 9 additions & 0 deletions src/firebird/driver/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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)
Expand Down

0 comments on commit 6ba0654

Please sign in to comment.