XTPImageManager::AddIcons appears to be buggy. |
Post Reply |
Author | |||||
lviolette
Groupie Joined: 17 March 2007 Location: United States Status: Offline Points: 62 |
Post Options
Thanks(0)
Posted: 01 September 2023 at 6:57pm |
||||
Code that worked in 18.3, but appears to be broken in 22.1. This code is lead-up to a crash I'm having while migrating to 22.1
Consider the following:
Attempt to explain why we crash...
This function adds icons from one image manager to another. It does so by iterating over the icons, retrieving each iconset and passing the iconset to
This function then iterates over the various icons in the icons set and adds them to the iconset of the image manager. But, it does so by constructing a CXTPImageManagerIcon like so:
That pIconSetAdd is actually (&localImageManager). And it's being used as the image manager in this new icon. Which is invalid. This logic has changed since 18.3. In 22.1, it crashes in CXTPImageManager::SetIcon(const CXTPImageManagerIconHandle& hIcon) because I am updating one of the images and it hits this code:
Since m_pIconSet is pointing to the deleted localImageManager, it crashes. In 18.3 m_pIconSet here would have been nullptr, so it would have skipped calling RefreshAll. My question is... Is CXTPImageManager::AddIcons(CXTPImageManager* pImageManager) working as intended? Is it suppose to take the images in pImageManager, add them to "this", but leave them with pointers to pImageManager rather than "this"? I'd like an answer to this before I rewrite this code I inherited to add the icons the to image manager and correctly set the iconset's m_pImageManager pointer. |
|||||
L. Violette
Monolith www.lith.com Xtreme Toolkit Pro v22.1.0 |
|||||
lviolette
Groupie Joined: 17 March 2007 Location: United States Status: Offline Points: 62 |
Post Options
Thanks(0)
|
||||
As a work-around, and possibly a more correct way to do this. I updated the code to avoid a temporary CXTPImageManager and it "appears" to be functioning correctly.
|
|||||
L. Violette
Monolith www.lith.com Xtreme Toolkit Pro v22.1.0 |
|||||
agontarenko
Admin Group Joined: 25 March 2016 Status: Offline Points: 299 |
Post Options
Thanks(0)
|
||||
Hello,
Unfortunately we are unable to re-produce the problem. Can you please provide more detailed information and steps to take, screenshots or video can be useful as well. If it cannot be re-produced in any of our sample applications provided I would appreciate you sending a small code snippet or ideally a sample application so that we could debug it. Regards, Artem Gontarenko |
|||||
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 |