<?xml version="1.0" encoding="utf-8" ?>
<?xml-stylesheet type="text/xsl" href="RSS_xslt_style.asp" version="1.0" ?>
<rss version="2.0" xmlns:WebWizForums="https://syndication.webwiz.net/rss_namespace/">
 <channel>
  <title>Codejock Developer Community : [16.3; VS2012] SkinM. Access violation upon exit</title>
  <link>http://forum.codejock.com/</link>
  <description><![CDATA[This is an XML content feed of; Codejock Developer Community : Skin Framework : [16.3; VS2012] SkinM. Access violation upon exit]]></description>
  <copyright>Copyright (c) 2006-2013 Web Wiz Forums - All Rights Reserved.</copyright>
  <pubDate>Mon, 25 May 2026 09:02:23 +0000</pubDate>
  <lastBuildDate>Thu, 20 Mar 2014 10:17:50 +0000</lastBuildDate>
  <docs>http://blogs.law.harvard.edu/tech/rss</docs>
  <generator>Web Wiz Forums 12.04</generator>
  <ttl>360</ttl>
  <WebWizForums:feedURL>forum.codejock.com/RSS_post_feed.asp?TID=22243</WebWizForums:feedURL>
  <image>
   <title><![CDATA[Codejock Developer Community]]></title>
   <url>http://forum.codejock.com/forum_images/codejock-logo.gif</url>
   <link>http://forum.codejock.com/</link>
  </image>
  <item>
   <title><![CDATA[[16.3; VS2012] SkinM. Access violation upon exit : I have a problem upon exiting...]]></title>
   <link>http://forum.codejock.com/forum_posts.asp?TID=22243&amp;PID=72371&amp;title=16-3-vs2012-skinm-access-violation-upon-exit#72371</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://forum.codejock.com/member_profile.asp?PF=5198">SMaton</a><br /><strong>Subject:</strong> 22243<br /><strong>Posted:</strong> 20 March 2014 at 10:17am<br /><br />I have a problem upon exiting my application (in debug mode). It's related to the SkinManager which seems to get accessed <b>after </b>the SkinManager instance has been deleted.<div><br></div><div>On exiting the application, this error is launched:</div><div><br></div><div><table width="99%"><tr><td><pre class="BBcode">Unhandled exception at 0x0987EAA6 (ToolkitPro1630vc110D.dll) in XXX.exe: 0xC0000005: Access violation reading location 0xFEEEFF36.</pre></td></tr></table></div><div><br></div><div>Hitting break leads to the function GetMetrics() of&nbsp;CXTPSkinManagerSchema. One step higher, I'm in&nbsp;CXTPSkinManager::GetMetrics() and even one step higher I'm in&nbsp;CXTPSkinManagerApiHook::OnHookDeleteObject().</div><div><br></div><div>Now, this function is called upon exiting the application (callstack via CCmdTarget::OnFinalRelease()). It shows that XTPSkinManager() returns a "valid" pointer, which in fact is a singleton instance.</div><div><br></div><div>Further debugging and placing a breakpoint in the destructor of the&nbsp;CXTPSkinManager, it shows that it's actually destructed BEFORE the CXTPSkinManagerApiHook::OnHookDeleteObject() has been called.<br><div><br></div><div>The destructor looks like this:</div><div><div><table width="99%"><tr><td><pre class="BBcode">static class CXTPSkinManager::CDestructor</div><div>{</div><div>public:</div><div><span ="Apple-tab-span" style="white-space:pre">	</span>~CDestructor()</div><div><span ="Apple-tab-span" style="white-space:pre">	</span>{</div><div><span ="Apple-tab-span" style="white-space:pre">		</span>if (s_pInstance != NULL)</div><div><span ="Apple-tab-span" style="white-space:pre">			</span>delete s_pInstance;</div><div><span ="Apple-tab-span" style="white-space:pre">	</span>}</div><div><br></div><div>} __xtpSkinManagerDestructor;</div></div><div></pre></td></tr></table></div></div><div><br></div><div>It's clear that either the destruction should be called much later OR that the s_pInstance should be set to NULL.</div><div><br></div><div>I've tried latter solution but this leads to memory leaks, since a new SkinManager instance is created via XTPSkinManager()-&gt;GetMetrics() in CXTPSkinManagerApiHook::OnHookDeleteObject() which is then not deleted anymore.</div><div><br></div><div>Did you solve this bug?</div>]]>
   </description>
   <pubDate>Thu, 20 Mar 2014 10:17:50 +0000</pubDate>
   <guid isPermaLink="true">http://forum.codejock.com/forum_posts.asp?TID=22243&amp;PID=72371&amp;title=16-3-vs2012-skinm-access-violation-upon-exit#72371</guid>
  </item> 
 </channel>
</rss>