8000 Merge pull request #365 from vmuriart/pyobject_finalize · pythonnet/pythonnet@8afd512 · GitHub
[go: up one dir, main page]

Skip to content

Commit 8afd512

Browse files
authored
Merge pull request #365 from vmuriart/pyobject_finalize
Fix Pyobject GC Finalize & Enable NUnit Exit Code
2 parents d82ca28 + c954442 commit 8afd512

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

CHANGELOG.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ This document follows the conventions laid out in [Keep a CHANGELOG][].
1212
- Code Coverage (#345)
1313
- Added `pysetargv` (#347)
1414
- Added XML Documentation (#349)
15+
- Added Embedded tests on Appveyor (#353)
1516
- Added PY3 settings to configuration-manager (#346)
1617

1718
### Changed
@@ -21,11 +22,11 @@ This document follows the conventions laid out in [Keep a CHANGELOG][].
2122
- Completed refactor of Build Directives on `Runtime.cs` (#339)
2223
- Refactor python unittests (#329)
2324
- Unfroze Mono version on Travis (#345)
24-
- Enabled Embedded tests on Appveyor (#353)
2525

2626
### Fixed
2727

28-
- Fixed crash during Shutdown (#343)
28+
- Fixed crash during Initialization (#343)
29+
- Fixed crash during Shutdown (#365)
2930

3031
### Removed
3132

ci/appveyor_run_tests.ps1

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,7 @@ if ($NUNIT_STATUS -ne 0) {
2626
}
2727

2828
# Embedded tests failing due to open issues, pass/fail only on Python exit code
29-
# if ($PYTHON_STATUS -ne 0 -or $NUNIT_STATUS -ne 0) {
30-
if ($PYTHON_STATUS -ne 0) {
29+
if ($PYTHON_STATUS -ne 0 -or $NUNIT_STATUS -ne 0) {
3130
Write-Host "Tests failed" -ForegroundColor "Red"
3231
$host.SetShouldExit(1)
3332
}

src/runtime/pyobject.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ protected virtual void Dispose(bool disposing)
113113
{
114114
if (!disposed)
115115
{
116-
if (Runtime.Py_IsInitialized() > 0)
116+
if (Runtime.Py_IsInitialized() > 0 && !Runtime.IsFinalizing)
117117
{
118118
IntPtr gs = PythonEngine.AcquireLock();
119119
Runtime.XDecref(obj);

0 commit comments

Comments
 (0)
0