[C#] Use an instance of the callback delegate, not the fn itself
authorMatt Corallo <git@bluematt.me>
Tue, 23 Jan 2024 21:19:51 +0000 (21:19 +0000)
committerMatt Corallo <git@bluematt.me>
Mon, 29 Jan 2024 16:37:41 +0000 (16:37 +0000)
commit52329a425adbefe5776a2fb01b516d31634518d8
tree0b7523b37de518d700a6e0104171b1fd599fb9b1
parentfb92bb63a4dade8b58c9c648320f8feb9ad2ea5d
[C#] Use an instance of the callback delegate, not the fn itself

When passing the callback delegate to C from C# during static init,
it appears (but only on Windows) this actually creates a C# class
instance for the delegate and passes that. However, that class
instance is eventually GC'd and our callbacks will start failing.

Instead, we create a static instance of of the delegate and pass
that to C.
csharp_strings.py