FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

Fix Re-initialization by filmor · Pull Request #343 · pythonnet/pythonnet · GitHub

Fix Re-initialization - #343

Merged
vmuriart merged 2 commits into
pythonnet:masterfrom
filmor:fix-shutdown
Jan 31, 2017
Merged

Fix Re-initialization#343
vmuriart merged 2 commits into
pythonnet:masterfrom
filmor:fix-shutdown

Conversation

filmor commented Jan 30, 2017

Copy link
Copy Markdown
Member

What does this implement/fix? Explain your changes.

Fixes issue #262 by countering two memory corruption issues.

Does this close any currently open issues?

#262.

Any other comments?

Is currently based on my other PR, but doesn't strictly need it, I could rebase.

codecov-io commented Jan 30, 2017
edited by codecov Bot
Loading

Copy link
Copy Markdown

Codecov Report

❗ No coverage uploaded for pull request head (fix-shutdown@af6d37f).


Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 2d1da5d...af6d37f. Read the comment docs.

Copy link
Copy Markdown
Contributor

Is this branch contain the same changes from #341? I'm reading it from my phone so hard to tell.

Copy link
Copy Markdown
Contributor

To answer my own question, it is. I'm testing this now but its looking good!

Copy link
Copy Markdown
Contributor

Copy link
Copy Markdown
Contributor

@filmor you ok with me rebasing your work ontop of the master branch and push it here?

throw new PythonException();
}

return new PyObject(result);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

I don't really see the issue here.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

To elaborate, the link that you posted warns against relying on try {} finally {} as the finally may not be executed, but in such a case the problem has either exited already or is in the process of doing so, so we don't have to worry about dereferencing the Python resources anyhow.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

It was more of a caveat, return statements within try statements confuse me at times.

filmor force-pushed the fix-shutdown branch 2 times, most recently from 7e26298 to 3e1a313 Compare January 31, 2017 06:44
Comment thread src/runtime/importhook.cs Outdated
}
}

internal static void Cleanup()

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Is there a call to Cleanup missing?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

That part is not used anymore as there is only a single ModuleDef instance that is kept for the whole run time, I'll remove it.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Cool, after it's removed I'm ok merging it. This fixes the issue for Python2.7, but it still occassionally fails on Python3 but it seems to be due to a different section of code

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Yeah, I noticed that too, I'll try to reproduce the issue, for me it happens (after these patches) not anymore on Shutdown but only on Initialize.

Copy link
Copy Markdown
Contributor

Cool, will merge after CI completes. Thanks!

vmuriart merged commit af6d37f into pythonnet:master Jan 31, 2017
vmuriart added a commit that referenced this pull request Jan 31, 2017
filmor deleted the fix-shutdown branch January 31, 2017 20:52
vmuriart changed the title Fix shutdown Fix Re-initialization Feb 8, 2017
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants


Back | FazBrowse Home | New Git URL