Hi guys,

I have Qt (5.2.1) GUI application which I'm trying to expose as an ActiveX control. As usual after dll is built I call idc.exe to generate IDL. The problem is idc.exe always crashes on unloading QtCore.dll.

The main widget have some initialization/finalization code which is required for app to work. This code at some point create QRegEx object, which inside Qt leads to initializing QRegExpEngine and putting it to global static QCache hash.

Here is the stack trace:

Qt Code:
  1. Qt5Cored.dll!QGenericAtomicOps<QAtomicOpsBySize<4> >::load<long>(const long & _q_value) Line 96 C++
  2. Qt5Cored.dll!QBasicAtomicInteger<int>::load() Line 142 C++
  3. Qt5Cored.dll!QtPrivate::RefCount::deref() Line 66 C++
  4. Qt5Cored.dll!QString::~QString() Line 921 C++
  5. Qt5Cored.dll!QRegExpEngineKey::~QRegExpEngineKey() C++
  6. Qt5Cored.dll!QHashNode<QRegExpEngineKey,QCache<QRegExpEngineKey,QRegExpEngine>::Node>::~QHashNode<QRegExpEngineKey,QCache<QRegExpEngineKey,QRegExpEngine>::Node>() C++
  7. Qt5Cored.dll!QHashNode<QRegExpEngineKey,QCache<QRegExpEngineKey,QRegExpEngine>::Node>::`scalar deleting destructor'(unsigned int) C++
  8. Qt5Cored.dll!QHash<QRegExpEngineKey,QCache<QRegExpEngineKey,QRegExpEngine>::Node>::deleteNode2(QHashData::Node * node) Line 544 C++
  9. Qt5Cored.dll!QHashData::free_helper(void (QHashData::Node *) * node_delete) Line 423 C++
  10. Qt5Cored.dll!QHash<QRegExpEngineKey,QCache<QRegExpEngineKey,QRegExpEngine>::Node>::freeData(QHashData * x) Line 590 C++
  11. Qt5Cored.dll!QHash<QRegExpEngineKey,QCache<QRegExpEngineKey,QRegExpEngine>::Node>::~QHash<QRegExpEngineKey,QCache<QRegExpEngineKey,QRegExpEngine>::Node>() Line 301 C++
  12. Qt5Cored.dll!QHash<QRegExpEngineKey,QCache<QRegExpEngineKey,QRegExpEngine>::Node>::clear() Line 596 C++
  13. Qt5Cored.dll!QCache<QRegExpEngineKey,QRegExpEngine>::clear() Line 127 C++
  14. Qt5Cored.dll!QCache<QRegExpEngineKey,QRegExpEngine>::~QCache<QRegExpEngineKey,QRegExpEngine>() Line 95 C++
  15. Qt5Cored.dll!QCache<QRegExpEngineKey,QRegExpEngine>::`scalar deleting destructor'(unsigned int) C++
  16. Qt5Cored.dll!``anonymous namespace'::Q_QGS_globalEngineCache::innerFunction'::`8'::Cleanup::~Cleanup() Line 3825 C++
  17. Qt5Cored.dll!``anonymous namespace'::Q_QGS_globalEngineCache::innerFunction'::`9'::`dynamic atexit destructor for 'cleanup''() C++
  18. Qt5Cored.dll!_CRT_INIT(void * hDllHandle, unsigned long dwReason, void * lpreserved) Line 416 C
  19. Qt5Cored.dll!__DllMainCRTStartup(void * hDllHandle, unsigned long dwReason, void * lpreserved) Line 522 C
  20. Qt5Cored.dll!_DllMainCRTStartup(void * hDllHandle, unsigned long dwReason, void * lpreserved) Line 472 C
  21. ntdll.dll!776699a0() Unknown
  22. [Frames below may be incorrect and/or missing, no symbols loaded for ntdll.dll]
  23. ntdll.dll!7767d702() Unknown
  24. ntdll.dll!7767d5a4() Unknown
  25. kernel32.dll!770279ed() Unknown
  26. msvcr110.dll!__crtExitProcess(int status) Line 725 C
  27. msvcr110.dll!doexit(int code, int quick, int retcaller) Line 627 C
  28. msvcr110.dll!exit(int code) Line 395 C
  29. idc.exe!00e32f73() Unknown
  30. kernel32.dll!7702338a() Unknown
  31. ntdll.dll!77669f72() Unknown
  32. ntdll.dll!77669f45() Unknown
To copy to clipboard, switch view to plain text mode 

Any ideas?

Thank you!

Kind regards, Ivan