Print Page | Close Window

App Crash on Exit

Printed From: Codejock Forums
Category: Codejock Products
Forum Name: Toolkit Pro
Forum Description: Topics Related to Codejock Toolkit Pro
URL: http://forum.codejock.com/forum_posts.asp?TID=23277
Printed Date: 23 December 2024 at 2:03pm
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: App Crash on Exit
Posted By: evoX
Subject: App Crash on Exit
Date Posted: 03 March 2017 at 4:49am
It always crashes in this line when I exit the app.

file: XTPImageManager.cpp

void CXTPImageManagerIconHandle::Clear()
{
   ...
   m_pRInfo->pResource->Clear(m_pRInfo);  // Crashes here
   ...
}


What can cause this?


-------------
Product: Xtreme ToolkitPro 19.30
Platform: Windows 10 64bit
Language: Visual C++ (VS 2019)



Replies:
Posted By: olebed
Date Posted: 03 March 2017 at 9:00am
Hello evoX,

I think you should increase reference counter of CXTPImageManagerIcon, instead of
m_btnSettings.SetIcon(CSize(24, 24), XTPImageManager()->GetImage(IDC_BUTTON_SETTINGS, 24));
use
CXTPImageManagerIcon* pIcon = XTPImageManager()->GetImage(IDC_BUTTON_SETTINGS, 24);
pIcon->InternalAddRef();
m_btnSettings.SetIcon(CSize(24, 24), pIcon);

Regards,
 Oleksandr Lebed


Posted By: evoX
Date Posted: 03 March 2017 at 12:23pm
Thanks! I will try that. I have to change it many places.

-------------
Product: Xtreme ToolkitPro 19.30
Platform: Windows 10 64bit
Language: Visual C++ (VS 2019)


Posted By: evoX
Date Posted: 03 March 2017 at 12:24pm
I think it will be better if the GetImage function from ToolkitPro to include the AddRef automatically.

-------------
Product: Xtreme ToolkitPro 19.30
Platform: Windows 10 64bit
Language: Visual C++ (VS 2019)


Posted By: Fredrik
Date Posted: 06 March 2017 at 6:04am
Originally posted by evoX evoX wrote:

I think it will be better if the GetImage function from ToolkitPro to include the AddRef automatically.

I agree - because how do you know when you have to call InternalAddRef and when not? The documentation doesn't say anything about it.


-------------
Windows 10, Visual Studio 20157, Toolkit Pro 18.3.0



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