Hello,<div>I am developing a gtkmm (2.4) cross-platform application on Win32 using MSVC2008 (v 9). My app has dependency on cairomm (installed version 1.0). There is no problem compiling the application, however once run in debug mode the application encounters a breakpoint as described below</div>
<div><br></div><div>this is the code snippet where I create a cairo context for my custom widget.</div><div><br></div><div><div>void CNumParam::on_size_allocate(Gtk::Allocation &amp;refAlloc)</div><div>{</div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;Cairo::RefPtr&lt;Cairo::Context&gt; refCairo;</div>
<div><span class="Apple-tab-span" style="white-space:pre">        </span>Glib::RefPtr&lt;Pango::Layout&gt; refPango;</div><div>&nbsp;&nbsp; &nbsp;</div><div><span class="Apple-tab-span" style="white-space:pre">        </span>//Set allocation</div><div>
<span class="Apple-tab-span" style="white-space:pre">        </span>set_allocation(refAlloc);</div><div><br></div><div><span class="Apple-tab-span" style="white-space:pre">        </span>//Do the rest only if a windows is available</div>
<div><span class="Apple-tab-span" style="white-space:pre">        </span>if (m_refWnd) {</div><div><span class="Apple-tab-span" style="white-space:pre">                </span>//Get the cairo context of the window</div><div><span class="Apple-tab-span" style="white-space:pre">                </span>refCairo = m_refWnd-&gt;create_cairo_context();</div>
<div><br></div><div><span class="Apple-tab-span" style="white-space:pre">                </span>//Create a pango layout attatched to the cairo context</div><div><span class="Apple-tab-span" style="white-space:pre">                </span>refPango = Pango::Layout::create(refCairo);</div>
<div><br></div><div><span class="Apple-tab-span" style="white-space:pre">                </span>OnSizeAllocate(refPango, refAlloc);</div><div><span class="Apple-tab-span" style="white-space:pre">        </span>}</div><div>}</div></div><div><br>
</div><div>As the Cairo::RefPtr variable goes out of scope, it begins to get deallocated since it is not been referenced from anywhere else, and thats when my program crashes. The assertion is encountered within &quot;dbgdel.cpp&quot; (an MSVC file).</div>
<div><br></div><div><div>void operator delete(void *pUserData)</div><div>{</div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;_CrtMemBlockHeader * pHead;</div><div><br></div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;RTCCALLBACK(_RTC_Free_hook, (pUserData, 0));</div><div><br></div><div>
&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;if (pUserData == NULL)</div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;return;</div><div><br></div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;_mlock(_HEAP_LOCK); &nbsp;/* block other threads */</div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;__TRY</div><div><br></div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;/* get a pointer to memory block header */</div>
<div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;pHead = pHdr(pUserData);</div><div><br></div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; /* verify block type */</div><div><span class="Apple-style-span" style="font-weight: bold;">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;_ASSERTE(_BLOCK_TYPE_IS_VALID(pHead-&gt;nBlockUse)); /*This is where my app gets stuck*/</span></div>
<div><br></div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;_free_dbg( pUserData, pHead-&gt;nBlockUse );</div><div><br></div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;__FINALLY</div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;_munlock(_HEAP_LOCK); &nbsp;/* release other threads */</div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;__END_TRY_FINALLY</div>
<div><br></div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;return;</div><div>}</div><div><br></div><div>There are no problems when I compile in Release mode. Also I tried compiling the same code from Linux (FC9) using gcc no issues at all.</div><div><br>
</div><div>Am I using an old version of cairomm or are there any compatibility issues??</div><div><br></div><div>Thanks in advance</div><div>Mohith</div></div>