Skip to content

Conversation

jmlidbetter
Copy link
Contributor

What does this implement/fix? Explain your changes.

Fixes an issue where pythonnet attempts to cast one managed delegate to another. This is explicitly forbidden in the documentation: see here. In particular:

You cannot use this method to create a delegate from a function pointer to another managed delegate

I have also removed the usage of the obselete function GetDelegateForFunctionPointer(IntPtr, Type) and replaced it with GetDelegateForFunctionPointer<IntPtr).

Does this close any currently open issues?

No

Any other comments?

It seems like this issue got partially fixed in PR #550 and was mentioned in issue #96. See also this related issue in dotnet core.

Checklist

Check all those that are applicable and complete.

  • Make sure to include one or more tests for your change
  • If an enhancement PR, please create docs and at best an example
  • Add yourself to AUTHORS
  • Updated the CHANGELOG

…n the NET standard documentation for GetDelegateForFunctionPointer
@Cronan
Copy link
Contributor

Cronan commented Aug 12, 2019

@filmor I don't believe I can kick the build ...

@jmlidbetter jmlidbetter reopened this Aug 19, 2019
@lostmsu
Copy link
Member

lostmsu commented Aug 19, 2019

@jmlidbetter can you open a bug for the issue you are trying to fix with repro steps?

@jmlidbetter
Copy link
Contributor Author

@lostmsu You can repro the issue by compiling in dotnet core which I don't believe is officially supported so didnt think an issue is strictly necessary in this case. Check out pr 550 for more background / precedent on the changes as well as the other things mentioned above :)

@lostmsu
Copy link
Member

lostmsu commented Aug 20, 2019

Looks good to me.

@filmor filmor merged commit f1da55e into pythonnet:master Aug 26, 2019
AlexCatarino pushed a commit to QuantConnect/pythonnet that referenced this pull request Jun 18, 2020
…n the NET standard documentation for GetDelegateForFunctionPointer (pythonnet#936)
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.

4 participants
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy