Print Page | Close Window

CXTPButton::SetIcon(nullptr) crashes in 19.2

Printed From: Codejock Forums
Category: Codejock Products
Forum Name: Controls
Forum Description: Topics Related to Codejock Controls
URL: http://forum.codejock.com/forum_posts.asp?TID=24004
Printed Date: 21 November 2024 at 10:23am
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: CXTPButton::SetIcon(nullptr) crashes in 19.2
Posted By: Fredrik
Subject: CXTPButton::SetIcon(nullptr) crashes in 19.2
Date 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



Replies:
Posted By: astoyan
Date Posted: 24 June 2020 at 3:20pm
Thank you for reporting the issue. The problem has been addressed for the next update.

Regards,
  Alexander



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