vendredi 22 juin 2018

How can I prevent the garbage collector from tampering with a memory allocated to a delegate

We have a .NET web api controller in c# from which I create a background thread to call a long running method in a dll. the long running method gets a delegate as a parameter. it seems like after a while that delegate is being collected which leads to an access violation exception. How can I prevent the garbage collector from collecting/rewriting that memory?

Thanks

Aucun commentaire:

Enregistrer un commentaire