> >Forgetting to manage the lock around a callback into Python > >is almost certain to cause a NullReferenceException (because > >there will be no valid thread state when the callback is > >made). > > > > > > Is this take care of when a C# instance calls a delegate, wich is a > python function? Or do we need to take the same care? (i.e. wrap the > call to the delegate in a AcquireLock/ReleaseLock section). > > thanks! > > Stan.
No, I was just starting to look at your report, and I don't _think_ its the same thing. When PythonNet creates a delegate with a Python implementation, it generates the actual managed wrapper delegate and includes the necessary calls to AcquireLock() and ReleaseLock(). There are a bunch of unit tests for delegates that don't exhibit this behavior - the main difference I can see is that your delegate runs on a different thread (which shouldn't matter, but its a place to start). Brian Lloyd [EMAIL PROTECTED] V.P. Engineering 540.361.1716 Zope Corporation http://www.zope.com _________________________________________________ Python.NET mailing list - PythonDotNet@python.org http://mail.python.org/mailman/listinfo/pythondotnet