Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > Visual C++ MFC > Toolkit Pro
  New Posts New Posts RSS Feed - App Crash on Exit
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

App Crash on Exit

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

Joined: 25 July 2007
Status: Offline
Points: 207
Post Options Post Options   Thanks (0) Thanks(0)   Quote evoX Quote  Post ReplyReply Direct Link To This Post Topic: App Crash on Exit
    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)
Back to Top
olebed View Drop Down
Admin Group
Admin Group


Joined: 01 July 2014
Location: Ukraine
Status: Offline
Points: 841
Post Options Post Options   Thanks (0) Thanks(0)   Quote olebed Quote  Post ReplyReply Direct Link To This Post 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
Back to Top
evoX View Drop Down
Senior Member
Senior Member
Avatar

Joined: 25 July 2007
Status: Offline
Points: 207
Post Options Post Options   Thanks (0) Thanks(0)   Quote evoX Quote  Post ReplyReply Direct Link To This Post 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)
Back to Top
evoX View Drop Down
Senior Member
Senior Member
Avatar

Joined: 25 July 2007
Status: Offline
Points: 207
Post Options Post Options   Thanks (0) Thanks(0)   Quote evoX Quote  Post ReplyReply Direct Link To This Post 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)
Back to Top
Fredrik View Drop Down
Senior Member
Senior Member


Joined: 22 June 2005
Status: Offline
Points: 235
Post Options Post Options   Thanks (0) Thanks(0)   Quote Fredrik Quote  Post ReplyReply Direct Link To This Post 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
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.141 seconds.