Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > Visual C++ MFC > Toolkit Pro
  New Posts New Posts RSS Feed - CXTPObservable leaks during XTPShutdown
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

CXTPObservable leaks during XTPShutdown

 Post Reply Post Reply
Author
Message
ganzeiss View Drop Down
Newbie
Newbie


Joined: 25 November 2024
Status: Offline
Points: 5
Post Options Post Options   Thanks (0) Thanks(0)   Quote ganzeiss Quote  Post ReplyReply Direct Link To This Post Topic: CXTPObservable leaks during XTPShutdown
    Posted: 19 January 2025 at 9:19pm
Hi, I am currently migrating from CodeJock 19.3 to CodeJock 24.0 and found that this issue is occurring to me. I use the static function CXTPPaintManager::SetTheme(xtpThemeVisualStudio2015) to set the theme for the paint manager. 

However, when I call CXTPWinApp::ExitInstance(), and as the app starts to close, when XTPShutdown() is called during ~XTPApplication(), I get an assertion error during:
template<class Owner, class Observer>
AFX_INLINE CXTPObservable<Owner, Observer>::~CXTPObservable()
{
    ASSERT("All observers must be unsubscribed before destruction" && 0 == m_Observers.GetSize());
}

I can use CXTPPaintManager::SetTheme(xtpThemeOffice2000) before calling CXTPWinApp::ExitInstance(), this error doesn't occur. I wanted to ask if there is a more elegant solution, or if this workaround is the only solution at the moment.
Back to Top
agontarenko View Drop Down
Admin Group
Admin Group


Joined: 25 March 2016
Status: Offline
Points: 301
Post Options Post Options   Thanks (0) Thanks(0)   Quote agontarenko Quote  Post ReplyReply Direct Link To This Post Posted: 18 hours 46 minutes ago at 9:05am
Hello,

It seems that quite a bit of time has passed between these revisions.
We have modified application themes, now it uses XTPPaintManager()->SetTheme(nTheme); call instead of CXTPPaintManager::SetTheme(), maybe this is the problem.

Please see how this is implemented in CommandBarControls.

Regards,
Artem Gonarenko
Back to Top
agontarenko View Drop Down
Admin Group
Admin Group


Joined: 25 March 2016
Status: Offline
Points: 301
Post Options Post Options   Thanks (0) Thanks(0)   Quote agontarenko Quote  Post ReplyReply Direct Link To This Post Posted: 18 hours 40 minutes ago at 9:11am
Can you provide sample with this problem?

Regards,
Artem Gonarenko
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.047 seconds.