Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > Visual C++ MFC > Skin Framework
  New Posts New Posts RSS Feed - How do I shut down SkinManager
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

How do I shut down SkinManager

 Post Reply Post Reply
Author
Message
rdhd View Drop Down
Senior Member
Senior Member
Avatar

Joined: 13 August 2007
Location: United States
Status: Offline
Points: 885
Post Options Post Options   Thanks (0) Thanks(0)   Quote rdhd Quote  Post ReplyReply Direct Link To This Post Topic: How do I shut down SkinManager
    Posted: 05 October 2021 at 5:43pm
I am trying to use Skinning in our app and am crashing while shutting down. When my frame window closes I call XTPShutdown. At that time, the ~CXTPSkinManager method gets called. During that call the ~XTP_SKINMANAGER_THREAD_STATE() function gets called but that is on another thread and not the thread on which I called XTPShutdown.

The call to shutdown returns and my application proceeds to complete its shutdown via common_exit. The loader is unloading DLLs and a call to AfxOleUnlockApp is made. That code asserts and that leads to a message box being displayed. I end up in CXTPSkinManager::CbtFilterHook. This is on the main thread and it is the only thread still running.

Nothing has set CXTPSkinManager::s_pInstance to nullptr. The manager appears to be a singleton and that is static instance data set when the manager is created. It is not set to null when the manager's destructor was called.

The result is in CbtFilterHook, this line crashes us:

pSkinManager->SetHook(hWnd, szClassName, lpcs, TRUE);

Shouldn't the manager destructor null out that static pointer?


     ToolkitPro2010vc160x64UD.dll!00007ffc79a24e68()    C++
>    ToolkitPro2010vc160x64UD.dll!CXTPSkinManager::CbtFilterHook(int code, unsigned __int64 wParam, __int64 lParam) Line 819    C++
     user32.dll!DispatchHookW()    Unknown
     user32.dll!__fnHkINLPCBTCREATESTRUCT()    Unknown
     ntdll.dll!KiUserCallbackDispatcherContinue()    Unknown
     win32u.dll!NtUserCreateWindowEx()    Unknown
     user32.dll!VerNtUserCreateWindowEx()    Unknown
     user32.dll!InternalCreateDialog()    Unknown
     user32.dll!InternalDialogBox()    Unknown
     user32.dll!SoftModalMessageBox()    Unknown
     user32.dll!MessageBoxWorker(struct _MSGBOXDATA *)    Unknown
     user32.dll!MessageBoxTimeoutW()    Unknown
     user32.dll!MessageBoxTimeoutA()    Unknown
     user32.dll!MessageBoxA()    Unknown
     JUtilD.dll!DisplayMessageBox(const wchar_t * lpszSubSystem, HWND__ * hWnd, const char * szText, const char * szCaption, unsigned int uType) Line 509    C++
     JUtilD.dll!JThreadMessageBox(const wchar_t * lpszSubSystem, HWND__ * hWnd, const char * szText, const char * szCaption, unsigned int uType) Line 592    C++
     JUtilD.dll!HRfatalmessageEx(const wchar_t * lpszSubSystem, const char * msg, const char * title) Line 263    C++
     JUtilD.dll!HRassertMessage(const wchar_t * lpszSubSystem, unsigned long level, const char * lpszMessage, const char * lpszTitle) Line 327    C++
     JUtilD.dll!HRCrtDbgReport(int reportType, char * lpszMessage, int * retVal) Line 476    C++
     ucrtbased.dll!_VCrtDbgReportA(int nRptType, void * returnAddress, const char * szFile, int nLine, const char * szModule, const char * szFormat, char * arglist) Line 391    C++
     ucrtbased.dll!_CrtDbgReport(int report_type, const char * file_name, int line_number, const char * module_name, const char * format, ...) Line 263    C++
     mfc140ud.dll!AfxAssertFailedLine(const char * lpszFileName, int nLine) Line 317    C++
     mfc140ud.dll!AfxOleUnlockApp() Line 62    C++


Back to Top
 Post Reply Post Reply
  Share Topic   

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.04
Copyright ©2001-2021 Web Wiz Ltd.

This page was generated in 0.125 seconds.