Skip to content
This repository was archived by the owner on Nov 10, 2025. It is now read-only.

Commit 7c5dfd2

Browse files
authored
Fix potential memory leak in SMART module & Update 3.3.1
1 parent 6b5d8ce commit 7c5dfd2

4 files changed

Lines changed: 63 additions & 26 deletions

File tree

CHANGELOG.md

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,46 @@
44
All notable changes to HardView Library (Python) will be documented in this file.
55

66

7+
## [3.3.1] - Hotfix Release
8+
9+
### Highlights:
10+
11+
* **SMART Module Memory Leak Fix:**
12+
13+
* Fixed a potential memory leak in the `scan_all_drives` function within the SMART module.
14+
* **API Update 3.3.1**
15+
16+
---
17+
18+
## [3.3.0] - Minor Release
19+
20+
### Highlights:
21+
22+
* **SMART Module for Windows**
23+
24+
* Added the `HardView.smart` module for retrieving SMART information for disks on Windows (HDD & SSD SATA).
25+
26+
* **SMBIOS Parsing Improvements**
27+
28+
* Fixed several errors in SMBIOS parsing within the `smbios` module for Windows.
29+
* **API Update 3.3.0**
30+
31+
> **Note:** All changes apply only to Windows; no changes for Linux.
32+
33+
---
34+
35+
## [3.3.0b1] - Beta Release
36+
37+
### Highlights:
38+
39+
* **New SMART Module for Windows**
40+
41+
* Added the `HardView.smart` module for retrieving SMART information for disks on Windows (HDD & SSD SATA).
42+
43+
> **Note:** This version is experimental (`beta`). Expect further changes before the stable `3.3.0` release.
44+
45+
---
46+
747
## [3.2.0] - Minor Release
848

949
### Highlights:

HardView/SMART/PySMART.cpp

Lines changed: 18 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -119,24 +119,22 @@ PYBIND11_MODULE(SMART, m) {
119119
"' valid=" + (reader.IsValid() ? "True" : "False") + ">";
120120
});
121121

122-
// Utility function
123-
m.def("scan_all_drives",
124-
[](int max_drives) {
125-
std::vector<std::pair<int, std::string>> errors;
126-
auto readers = ScanAllDrives(max_drives, &errors);
127-
128-
// Convert unique_ptr vector to regular vector for Python
129-
std::vector<SmartReader*> result;
130-
for (auto& reader : readers) {
131-
result.push_back(reader.release());
132-
}
133-
134-
py::tuple ret = py::make_tuple(result, errors);
135-
return ret;
136-
},
137-
py::arg("max_drives") = 8,
138-
"Scan all available drives and return tuple of (readers_list, errors_list)\n"
139-
"Returns: ([SmartReader, ...], [(drive_num, error_msg), ...])",
140-
py::return_value_policy::take_ownership
141-
);
122+
m.def("scan_all_drives",
123+
[](int max_drives) {
124+
std::vector<std::pair<int, std::string>> errors;
125+
auto readers = ScanAllDrives(max_drives, &errors);
126+
127+
// Convert unique_ptr vector to py::list with proper ownership
128+
py::list result;
129+
for (auto& reader : readers) {
130+
result.append(py::cast(reader.release(),
131+
py::return_value_policy::take_ownership));
132+
}
133+
134+
return py::make_tuple(result, errors);
135+
},
136+
py::arg("max_drives") = 8,
137+
"Scan all available drives and return tuple of (readers_list, errors_list)\n"
138+
"Returns: ([SmartReader, ...], [(drive_num, error_msg), ...])"
139+
);
142140
}

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
# HardView - Hardware Information Project
66

77
<p>
8-
<img src="https://img.shields.io/badge/PyPI_Stable-3.3.0-blue" alt="PyPI Stable Version" height="28">
8+
<img src="https://img.shields.io/badge/PyPI_Stable-3.3.1-blue" alt="PyPI Stable Version" height="28">
99
<img src="https://img.shields.io/badge/downloads-10.7K-red" alt="Version" height="28">
1010
<img src="https://img.shields.io/badge/python-3.8%20|%203.9%20|%203.10%20|%203.11%20|%203.12%20|%203.13%20|%203.14-blue" alt="Supported Python versions" height="28">
1111
</p>

setup.py

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -198,18 +198,17 @@ def get_ext_filename(self, ext_name):
198198

199199
setup(
200200
name='HardView',
201-
version='3.3.0',
201+
version='3.3.1',
202202
description='A comprehensive Python library for collecting hardware information and real-time performance monitoring.',
203203
long_description='''
204-
# HardView 3.3.0
204+
# HardView 3.3.1
205205
206206
A comprehensive Python library for querying low-level hardware information and monitoring system performance in real-time on Windows and Linux systems.
207207
208208
---
209209
210-
### Additions in 3.3.0
211-
- Fixing some errors in SMBIOS parsing in the smbios model for Windows.
212-
- A SMART module has been added to retrieve SMART information for disks on Windows (HDD & SSD SATA).
210+
### Fixes in 3.3.1
211+
- Fixed a potential memory leak in the SMART module scan_all_drives function.
213212
---
214213
215214
''',

0 commit comments

Comments
 (0)