<?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 : Memory Leak on CommandBars destruction</title>
  <link>http://forum.codejock.com/</link>
  <description><![CDATA[This is an XML content feed of; Codejock Developer Community : Command Bars : Memory Leak on CommandBars destruction]]></description>
  <copyright>Copyright (c) 2006-2013 Web Wiz Forums - All Rights Reserved.</copyright>
  <pubDate>Thu, 11 Jun 2026 05:15:42 +0000</pubDate>
  <lastBuildDate>Fri, 13 Jun 2008 06:35:40 +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=11015</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[Memory Leak on CommandBars destruction : Hi,  yes, after you link popupToolBar_p...]]></title>
   <link>http://forum.codejock.com/forum_posts.asp?TID=11015&amp;PID=36660&amp;title=memory-leak-on-commandbars-destruction#36660</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://forum.codejock.com/member_profile.asp?PF=6851">Oleg</a><br /><strong>Subject:</strong> 11015<br /><strong>Posted:</strong> 13 June 2008 at 6:35am<br /><br />Hi,<DIV>&nbsp;</DIV><DIV>yes, after you link popupToolBar_p to controlPopup_p you have decreate reference counts:</DIV><DIV>&nbsp;</DIV><DIV>controlPopup_p-&gt;SetCommandBar(popupToolBar_p);</DIV><DIV><strong>popupToolBar_p-&gt;InternalRelease();</strong></DIV>]]>
   </description>
   <pubDate>Fri, 13 Jun 2008 06:35:40 +0000</pubDate>
   <guid isPermaLink="true">http://forum.codejock.com/forum_posts.asp?TID=11015&amp;PID=36660&amp;title=memory-leak-on-commandbars-destruction#36660</guid>
  </item> 
  <item>
   <title><![CDATA[Memory Leak on CommandBars destruction :    ToolkitPro MFC version 12.0.0:I...]]></title>
   <link>http://forum.codejock.com/forum_posts.asp?TID=11015&amp;PID=36645&amp;title=memory-leak-on-commandbars-destruction#36645</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://forum.codejock.com/member_profile.asp?PF=1813">Paolo</a><br /><strong>Subject:</strong> 11015<br /><strong>Posted:</strong> 13 June 2008 at 2:50am<br /><br />ToolkitPro MFC version 12.0.0:<br>I built a simple MFC application, just run it and immediatly close. In my VS2008 IDE the output shows some memory leaks that are related to command bars structure. Here's the relevant output:<br><br><table width="99%"><tr><td><pre class="BBcode">Codejock ToolkitPro Terminating!<br>Detected memory leaks!<br>Dumping objects -&gt;<br>f:\dd\vctools\vc7libs\ship\atlmfc\src\mfc\strcore.cpp(141) : {400} normal block at 0x020D1938, 26 bytes long.<br>&nbsp;Data: &lt;d&nbsp; x&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &gt; 64 99 7F 78 09 00 00 00 09 00 00 00 01 00 00 00 <br>f:\microsoft visual studio 9.0\vc\atlmfc\include\afxtempl.h(401) : {399} normal block at 0x020D18F8, 4 bytes long.<br>&nbsp;Data: &lt;H&nbsp;&nbsp; &gt; 48 17 0D 02 <br>f:\dd\vctools\vc7libs\ship\atlmfc\src\mfc\strcore.cpp(141) : {398} normal block at 0x020D1FB8, 27 bytes long.<br>&nbsp;Data: &lt;d&nbsp; x&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &gt; 64 99 7F 78 0A 00 00 00 0A 00 00 00 01 00 00 00 <br>c:\programmi\codejock software\mfc\xtreme toolkitpro v12.0.0\source\commandbars\xtpcontrolbutton.cpp(35) : {397} client block at 0x020D1748, subtype c0, 372 bytes long.<br>a CXTPControlButton object at $020D1748, 372 bytes long<br>f:\dd\vctools\vc7libs\ship\atlmfc\src\mfc\strcore.cpp(141) : {396} normal block at 0x020D1F58, 30 bytes long.<br>&nbsp;Data: &lt;d&nbsp; x&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &gt; 64 99 7F 78 0D 00 00 00 0D 00 00 00 01 00 00 00 <br>c:\programmi\codejock software\mfc\xtreme toolkitpro v12.0.0\source\commandbars\xtpcommandbar.cpp(198) : {395} normal block at 0x020D1EE8, 48 bytes long.<br>&nbsp;Data: &lt;p&nbsp;&nbsp;&nbsp;&nbsp; `x&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &gt; 70 1B 0D 02 C4 A1 60 78 00 00 00 00 00 00 00 00 <br>c:\programmi\codejock software\mfc\xtreme toolkitpro v12.0.0\source\commandbars\xtpcontrols.cpp(51) : {394} client block at 0x020D1E68, subtype c0, 68 bytes long.<br>a CXTPControls object at $020D1E68, 68 bytes long<br>f:\dd\vctools\vc7libs\ship\atlmfc\src\mfc\strcore.cpp(141) : {393} normal block at 0x020D1E10, 27 bytes long.<br>&nbsp;Data: &lt;d&nbsp; x&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &gt; 64 99 7F 78 0A 00 00 00 0A 00 00 00 01 00 00 00 <br>c:\programmi\codejock software\mfc\xtreme toolkitpro v12.0.0\source\commandbars\xtppopupbar.cpp(1723) : {392} client block at 0x020D1B70, subtype c0, 608 bytes long.<br>a CXTPPopupToolBar object at $020D1B70, 608 bytes long<br>Object dump complete.</pre></td></tr></table><br><br>The line I'm actually focused on is follows:<br><br><table width="99%"><tr><td><pre class="BBcode">c:\programmi\codejock software\mfc\xtreme toolkitpro v12.0.0\source\commandbars\xtpcommandbar.cpp(198)</pre></td></tr></table><br><br>I included &lt;XTToolkitPro.h&gt; in stdafx.h, derived MainFrm class from CXTPMDIFrameWnd and in MainFrm.cpp file I modified<br><table width="99%"><tr><td><pre class="BBcode">int CMainFrame::OnCreate(LPCREATESTRUCT lpCreateStruct)</pre></td></tr></table><br>function by adding the code block I copied here:<br><br><table width="99%"><tr><td><pre class="BBcode">if ( !InitCommandBars() ) return -1;<br><br>CXTPCommandBars&nbsp; *commandBars_p&nbsp; = GetCommandBars();&nbsp; // Get Command Bars<br>CXTPCommandBar&nbsp;&nbsp; *commandBar_p &nbsp; = commandBars_p-&gt;Add("My Command Bar", xtpBarTop);&nbsp; // Add Command Bar<br>CXTPControl&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; *control_p &nbsp; &nbsp;&nbsp; = commandBar_p-&gt;GetControls()-&gt;Add(xtpControlSplitButtonPopup, 20000);&nbsp; // Add new Split Button Popup to the command bar<br>CXTPControlPopup *controlPopup_p = static_cast&lt;CXTPControlPopup *&gt;(control_p);&nbsp; // cast to CXTPControlPopup<br>CXTPPopupToolBar *popupToolBar_p = CXTPPopupToolBar::CreatePopupToolBar(commandBars_p);&nbsp; // Create Popup ToolBar<br>popupToolBar_p-&gt;SetTearOffPopup("Popup ToolBar", 20002);&nbsp; // Set PopupToolBar as Tear Of<br>controlPopup_p-&gt;SetCommandBar(popupToolBar_p);&nbsp; // Link CXTPControlPopup to PopupToolBar<br><br>CXTPControl&nbsp;&nbsp;&nbsp; &nbsp; *control2_p&nbsp;&nbsp;&nbsp; &nbsp;= popupToolBar_p-&gt;GetControls()-&gt;Add(xtpControlButton, 20001);<br>control2_p-&gt;SetCaption("Control 2");&nbsp; // Add Button to the PopupToolBar</pre></td></tr></table><br><br>I checked CXTPCommandBar destructor (xtpcommandbar.cpp lines 201 and following) and Command Bar titled "My Command Bar" is correctly deleted. But I can not find deletion of the&nbsp;CXTPPopupToolBar I created with <br>CXTPPopupToolBar::CreatePopupToolBar method.<br><br>I'm not sure if it's me not deleting correctly something or if something is missing in Codejock code.<br>Can somebody help me?<br>]]>
   </description>
   <pubDate>Fri, 13 Jun 2008 02:50:41 +0000</pubDate>
   <guid isPermaLink="true">http://forum.codejock.com/forum_posts.asp?TID=11015&amp;PID=36645&amp;title=memory-leak-on-commandbars-destruction#36645</guid>
  </item> 
 </channel>
</rss>