Assigning a method directly to a field expecting a delegate creates a delegate on the fly. This delegate can be collected normally as any collectable object. In dotnet the GC is more aggressive, causing this delegate to be collected and C trying to call an invalid function. To avoid this, we create a static delegate that will be passed to C. Its lifetime will be tied to the static method it wraps.devs/bu5hm4n/make_doc_cop_happy
parent
73df0d47ff
commit
00a1a203a5
1 changed files with 4 additions and 2 deletions
Loading…
Reference in new issue