Print Page | Close Window

How do I shut down SkinManager

Printed From: Codejock Forums
Category: Codejock Products
Forum Name: Skin Framework
Forum Description: Topics Related to Codejock Skin Framework
URL: http://forum.codejock.com/forum_posts.asp?TID=24221
Printed Date: 16 May 2024 at 3:56am
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: How do I shut down SkinManager
Posted By: rdhd
Subject: How do I shut down SkinManager
Date 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++





Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.04 - http://www.webwizforums.com
Copyright ©2001-2021 Web Wiz Ltd. - https://www.webwiz.net