WrapInNETBlock

WrapInNETBlock
is an option to AddEventHandler and NETNewDelegate that specifies whether or not the Mathematica callback function assigned to the delegate should be implicitly wrapped in NETBlock.

DetailsDetails

  • To use WrapInNETBlock, you first need to load .NET/Link using Needs["NETLink`"].
  • The default is True, so that objects sent to callback functions or created within them are treated as temporary and released when the callback completes.
  • If you need an object created in a callback function to persist in Mathematica after the callback completes, use WrapInNETBlock->False.
New to Mathematica? Find your learning path »
Have a question? Ask support »