This project is read-only.

Problem with garbage collection and delegate 'R.NET!RDotNet.Internals.blah3::Invoke'

Aug 27, 2012 at 3:32 PM
Edited Aug 28, 2012 at 9:31 AM


I am using visual studio 2010 and R.NET 1.4 and I am (sporadically) getting the following error message when using R.NET :

 “ A callback was made on a garbage collected delegate of type 'R.NET!RDotNet.Internals.blah3::Invoke'.This may cause application crashes, corruption and data loss. When passing delegates to unmanaged code, they must be kept alive by the managed application until it is guaranteed that they will never be called. “

I found this post dealing with the same problem some time ago but found no solution. )

The post and the given answers imply that it is an internal problem of R.NET’s memory management.

Can anyone give me pointers for a workaround?

Is the exact problem in the R.NET source code known and is there a fix in the works?

I think I could maybe code around this if I knew how to close and unload the REngine properly but this also seems to be buggy ( )


Any help would be greatly appreciated



R.NET version 1.5 seems to have solved the problem.

Dec 17, 2012 at 7:34 PM
Edited Dec 17, 2012 at 7:35 PM

I seem to still experience this problem with R.NET 1.5.