Using wodKeys in multiple threads - WeOnlyDo Discussion board

Using wodKeys in multiple threads (General questions)

by mulloju, Friday, November 04, 2011, 09:49 (4766 days ago)

Is wodKeys thread-safe? I'm experiencing occasional exceptions and automatic breaks complaining about possible heap corruption when calling this method in multiple parallel threads:

hr = pKeys.CreateInstance(CLSID_Keys, NULL);

I do this in every thread:

IKeysPtr pKeys;
HRESULT hr = NULL;
CoInitialize(NULL);
hr = pKeys.CreateInstance(CLSID_Keys, NULL);
...
pKeys.Release();
CoUninitialize();

Am I doing something wrong?


Complete thread: