Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > Visual C++ MFC > Controls
  New Posts New Posts RSS Feed - CXTPButton::SetIcon(nullptr) crashes in 19.2
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

CXTPButton::SetIcon(nullptr) crashes in 19.2

 Post Reply Post Reply
Author
Message
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 Topic: CXTPButton::SetIcon(nullptr) crashes in 19.2
    Posted: 24 June 2020 at 4:17am
Hi,

we got a crash when upgrading to 19.2 due to code that removes an icon from a CXTPButton by calling it with SetIcon(CSize(0,0), nullptr); Could you guys add a nullptr check?



BOOL CXTPButton::SetIcon(CSize size, CXTPImageManagerIcon* pIcon, BOOL bRedraw /*= TRUE*/)
{
// Construct the icon manager.
CMDTARGET_RELEASE(m_pIcon);

if (pIcon->IsVectorIcon()) // add check for nullptr
m_szVectorIcon = size;

m_pIcon = pIcon;

// Redraw the button.
if (bRedraw)
RedrawButton();

return TRUE;
}
Windows 10, Visual Studio 20157, Toolkit Pro 18.3.0
Back to Top
astoyan View Drop Down
Admin Group
Admin Group
Avatar

Joined: 24 August 2013
Status: Offline
Points: 304
Post Options Post Options   Thanks (1) Thanks(1)   Quote astoyan Quote  Post ReplyReply Direct Link To This Post Posted: 24 June 2020 at 3:20pm
Thank you for reporting the issue. The problem has been addressed for the next update.

Regards,
  Alexander
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.158 seconds.