![]() |
PostQuitMessage(0) causes crash |
Post Reply ![]() |
Author | |
znakeeye ![]() Senior Member ![]() ![]() Joined: 26 July 2006 Status: Offline Points: 1672 |
![]() ![]() ![]() ![]() ![]() Posted: 08 August 2009 at 7:55am |
XTP 13.1.
During startup:
XTPImageManager()->InternalAddRef();
m_pItems->SetImageManager(XTPImageManager()); And later:
PostQuitMessage(0);
Causing a crash in CCmdTarget::~CCmdTarget() for CXTPImageManager.
Any ideas?
|
|
PokerMemento - http://www.pokermemento.com/
|
|
![]() |
|
Oleg ![]() Admin Group ![]() Joined: 21 May 2003 Location: United States Status: Offline Points: 11234 |
![]() ![]() ![]() ![]() ![]() |
Hi, Please show call stack.
|
|
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS |
|
![]() |
|
znakeeye ![]() Senior Member ![]() ![]() Joined: 26 July 2006 Status: Offline Points: 1672 |
![]() ![]() ![]() ![]() ![]() |
Very easy to reproduce with your SDI-sample:
int CMainFrame::OnCreate(LPCREATESTRUCT lpCreateStruct)
{
...
...
PostMessage(WM_COMMAND, ID_STYLES_CHANGE);
return 0;
}
void CMainFrame::OnEmptyCommand() {
PostQuitMessage(0);
}
Probably not an issue, but still suspect that it crashes like this... |
|
PokerMemento - http://www.pokermemento.com/
|
|
![]() |
|
Oleg ![]() Admin Group ![]() Joined: 21 May 2003 Location: United States Status: Offline Points: 11234 |
![]() ![]() ![]() ![]() ![]() |
Hi,
I don't think PostQuitMessage is best way to terminate application - destructor of CMainFrame is not called and its reason of issue. Just close MainWindow instead if you need quit.
|
|
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS |
|
![]() |
|
znakeeye ![]() Senior Member ![]() ![]() Joined: 26 July 2006 Status: Offline Points: 1672 |
![]() ![]() ![]() ![]() ![]() |
I agree, but suppose some badly written code does this. Is it possible to destroy the object somehow? CWinApp::PreTranslateMessage?
|
|
PokerMemento - http://www.pokermemento.com/
|
|
![]() |
|
Tomasz ![]() Senior Member ![]() Joined: 05 August 2006 Status: Offline Points: 109 |
![]() ![]() ![]() ![]() ![]() |
Still, I don't see any reason why PostQuitMessage would need to create crash with XTP ? Isn't it a bug?
http://blogs.msdn.com/oldnewthing/archive/2005/11/04/489028.aspx |
|
![]() |
|
znakeeye ![]() Senior Member ![]() ![]() Joined: 26 July 2006 Status: Offline Points: 1672 |
![]() ![]() ![]() ![]() ![]() |
Sure it's a bug.
|
|
PokerMemento - http://www.pokermemento.com/
|
|
![]() |
Post Reply ![]() |
|
Tweet
|
Forum Jump | Forum Permissions ![]() You cannot post new topics in this forum You cannot reply to topics in this forum You cannot delete your posts in this forum You cannot edit your posts in this forum You cannot create polls in this forum You cannot vote in polls in this forum |