RaceOnRCWCleanup when closing WPF applications

Over the past few years, I have used WPF in a mixed mode application to display various bits and portions of the user interface. WPF is used by the C # assembly to create a user interface — it refers to a C ++ / CLI assembly that contains some native code. Native code does not cause OS calls outside of multiple printfs; it is purely computational.

When I start the application with the debugger attached, I see the “RaceOnRCWCleanup” managed debugging assistant running after the application is closed, which indicates the presence of some COM component with multithreading cleaning problems.

I do not use COM in any form directly, but maybe C ++ / CLI or WPF. Warnings about disabling applications are not particularly scary - after all, the application still exits, but I would like to understand what is going wrong. Can I do anything to avoid this warning? Is there a hidden bug somewhere that is just waiting to bite me, or is this a false warning?

This is a stacktrace example:

mscorlib.dll!System.Runtime.InteropServices.Marshal.ReleaseComObject(object o) Line 1826 + 0xc bytes C# PresentationFramework.dll!System.Windows.Documents.TextServicesHost.DeactivateThreadManager() Line 465 + 0xd bytes C# PresentationFramework.dll!System.Windows.Documents.TextServicesHost.OnUnregisterTextStore(object arg) Line 331 C# PresentationFramework.dll!System.Windows.Documents.TextEditor.DetachTextStore(bool finalizer) Line 249 + 0x6b bytes C# WindowsBase.dll!System.Windows.Threading.Dispatcher.ShutdownImplInSecurityContext(object state) Line 1363 + 0xfffffffc bytes C# mscorlib.dll!System.Threading.ExecutionContext.runTryCode(object userData) Line 484 + 0xce bytes C# 

Has anyone experienced the same issue? Does anyone know what is going on?

+7
race-condition clr wpf
source share
1 answer

Since when do you get this exception? I also got it today for the first time in our wpf business application. This happens continuously every time I close the application without making significant changes. Maybe Windows Update is a source of evil? We also did not find out where it came from and how to prevent it. I will send a solution as soon as we can solve the problem. I don't think this has anything to do with your C ++ / CLI build. We do not use C ++ / CLI assemblies.

Jan

+1
source share

All Articles