I have an c# app which creates and starts a directshow graph on the firing of a Threading.Timer event. some time later a different Timer instance attempts to stop and dispose the graph via Marshal.ReleaseComObject(theGraph).
This causes a threading issue and visual studio tells me that I risk data corruption by attempting to dispose of the com object (the graph in this case) from a different thread other than the one it was created on.
How do I get back onto the original thread to stop and dispose the graph?
I know very little about threading and I’ve been ignoring the issue, but I have some time now to learn more about threading and how I should make correct use of it.
any pointer most welcome.
I found the solution to my problem here: http://www.codeproject.com/Articles/12082/A-DelegateQueue-Class