Print Page | Close Window

DEBUG build crash in ~CXTThemeManager()

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=6418
Printed Date: 19 June 2025 at 3:46pm
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: DEBUG build crash in ~CXTThemeManager()
Posted By: MichaelN
Subject: DEBUG build crash in ~CXTThemeManager()
Date Posted: 14 February 2007 at 12:09pm

Often, when our App exits (debug build), I get an Access Violation crash in XTThemeManager. The ASSERT fails in the destructor. Is this a known issue and is there a fix? See code pasted below:

CXTThemeManager::~CXTThemeManager()
{
 POSITION pos = m_mapDefaultFactories.GetStartPosition();
 void* pThemeFactoryClass;
 CXTThemeManagerStyleFactory* pFactory = 0;
 while (pos)
 {
  m_mapDefaultFactories.GetNextAssoc(pos, pThemeFactoryClass, (void *&)pFactory);
  SAFE_DELETE(pFactory);
 }
 ASSERT(m_factoryList.m_pHead == 0);
 m_factoryList.RemoveAll();
}



Replies:
Posted By: Oleg
Date Posted: 15 February 2007 at 1:13am
Hi,
It means that you forget to destroy some object that use Themes - maybe button? Check what m_factoryList.m_pHead is, when it will appear.


-------------
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS


Posted By: yangyanglei
Date Posted: 01 December 2010 at 11:29pm

Have you solved the problem? How make it ?



Posted By: MichaelN
Date Posted: 26 January 2011 at 11:50am
No, and it happens sometimes, not other times.


Posted By: MichaelN
Date Posted: 26 January 2011 at 11:53am
One additional comment: I don't know why there is an ASSERT there, becuase the line after deletes all the theme objects anyway. Maybe a TRACE would have been better.


Posted By: Oleg
Date Posted: 27 January 2011 at 3:45am
Hi,

This ASSERT shows that something wrong. - that ThemeManager is destroyed now, but you still have some button/control that exists. most easy way is to check what value m_pHead is - it will show what Factory is not destroyed.

Most easy scenario to reproduce it is to create CXTButton dynamically (pButton = new CXTButton()) and never delete it.


-------------
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS



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