Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
A C++ local database library with cross language bindings. Aiming to be a fast, lightweight, and easy-to-use data communication solution for RPC and coupled modeling in scientific computing.

## What's new
- **2025-12-31(Bug Fix)**: Fixed an issue where shared memory segments were not being properly unregistered from the resource tracker upon closing, which could lead to resource leaks. (PR #17)
- **2025-12-15 (Release Improvement)**: Enabled distribution of pre-compiled binary wheels for macOS (Intel/Apple Silicon) and Linux (x86_64/aarch64), eliminating the need for local compilation tools during installation. (PR #15)
- **2025-12-10 (Bug Fix)**: Fixed the data type mapping for `U32` fields in Python bindings to ensure correct representation as unsigned 32-bit integers in NumPy arrays. (PR #13)
- **2025-12-10 (Bug Fix)**: Fixed an out-of-bounds access issue in `FastVectorDbLayer::Impl::getFieldOffset()` when the field index is equal to the field count. (PR #12)
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[project]
name = "fastdb4py"
version = "0.1.8"
version = "0.1.9"
description = "FastCarto database bindings"
readme = "README.md"
requires-python = ">=3.10"
Expand Down
11 changes: 9 additions & 2 deletions python/fastdb4py/orm/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
import numpy as np
from pathlib import Path
from dataclasses import dataclass
from multiprocessing import shared_memory
from typing import List, TypeVar, Type, Any, Generic
from multiprocessing import shared_memory, resource_tracker

from .. import core
from .table import Table
Expand Down Expand Up @@ -314,8 +314,15 @@ def get(self, feature_type: Type[T], name: str) -> T | None:
return feature_type.map_from(self._origin, of)

def close(self):
"""Close the database and release resources."""
"""
Close the database and release resources.

Warning:
After calling this method, the shared memory database will no longer be accessible.
Make sure to unlink the shared memory if you want to completely remove it through the unlink() method by other processes.
"""
if self._shm:
resource_tracker.unregister(self._shm._name, 'shared_memory')
self._shm.close()
self._shm = None
self._origin = None
Expand Down