Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > Visual C++ MFC > Toolkit Pro
  New Posts New Posts RSS Feed - DEBUG build crash in ~CXTThemeManager()
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

DEBUG build crash in ~CXTThemeManager()

 Post Reply Post Reply
Author
Message
MichaelN View Drop Down
Senior Member
Senior Member


Joined: 19 September 2006
Status: Offline
Points: 112
Post Options Post Options   Thanks (0) Thanks(0)   Quote MichaelN Quote  Post ReplyReply Direct Link To This Post Topic: DEBUG build crash in ~CXTThemeManager()
    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();
}
Back to Top
Oleg View Drop Down
Admin Group
Admin Group


Joined: 21 May 2003
Location: United States
Status: Offline
Points: 11234
Post Options Post Options   Thanks (0) Thanks(0)   Quote Oleg Quote  Post ReplyReply Direct Link To This Post 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
Back to Top
yangyanglei View Drop Down
Newbie
Newbie


Joined: 01 December 2010
Status: Offline
Points: 1
Post Options Post Options   Thanks (0) Thanks(0)   Quote yangyanglei Quote  Post ReplyReply Direct Link To This Post Posted: 01 December 2010 at 11:29pm

Have you solved the problem? How make it ?

Back to Top
MichaelN View Drop Down
Senior Member
Senior Member


Joined: 19 September 2006
Status: Offline
Points: 112
Post Options Post Options   Thanks (0) Thanks(0)   Quote MichaelN Quote  Post ReplyReply Direct Link To This Post Posted: 26 January 2011 at 11:50am
No, and it happens sometimes, not other times.
Back to Top
MichaelN View Drop Down
Senior Member
Senior Member


Joined: 19 September 2006
Status: Offline
Points: 112
Post Options Post Options   Thanks (0) Thanks(0)   Quote MichaelN Quote  Post ReplyReply Direct Link To This Post 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.
Back to Top
Oleg View Drop Down
Admin Group
Admin Group


Joined: 21 May 2003
Location: United States
Status: Offline
Points: 11234
Post Options Post Options   Thanks (0) Thanks(0)   Quote Oleg Quote  Post ReplyReply Direct Link To This Post 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
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.031 seconds.