Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Conversation

@lostmsu
Copy link
Member

@lostmsu lostmsu commented Jul 7, 2021

What does this implement/fix? Explain your changes.

When debugging code, that uses PyObject instances, debugger would try to execute PyObject.ToString to show PyObject values in watches window. That call causes AccessViolationException when the current thread does not hold global interpreter lock.

This change adds DebuggerDisplay attribute to PyObject, that makes debugger first check if GIL is held by the current thread, and only use ToString when it does. Otherwise, a message with object handle and a suggestion to acquire GIL is displayed.

@lostmsu lostmsu added the mini label Jul 7, 2021
@lostmsu lostmsu merged commit d300111 into pythonnet:master Jul 7, 2021
@lostmsu lostmsu deleted the Mini/DebugViewNoCrash branch July 7, 2021 18:12
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.

2 participants

Morty Proxy This is a proxified and sanitized view of the page, visit original site.