[cairo] gtkmm on Win32

Mohith Manoj mohithmanoj at gmail.com
Wed Nov 5 00:15:41 PST 2008

Hello,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

this is the code snippet where I create a cairo context for my custom

void CNumParam::on_size_allocate(Gtk::Allocation &refAlloc)
        Cairo::RefPtr<Cairo::Context> refCairo;
Glib::RefPtr<Pango::Layout> refPango;

//Set allocation

//Do the rest only if a windows is available
if (m_refWnd) {
//Get the cairo context of the window
refCairo = m_refWnd->create_cairo_context();

//Create a pango layout attatched to the cairo context
refPango = Pango::Layout::create(refCairo);

OnSizeAllocate(refPango, refAlloc);

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 "dbgdel.cpp"
(an MSVC file).

void operator delete(void *pUserData)
        _CrtMemBlockHeader * pHead;

        RTCCALLBACK(_RTC_Free_hook, (pUserData, 0));

        if (pUserData == NULL)

        _mlock(_HEAP_LOCK);  /* block other threads */

            /* get a pointer to memory block header */
            pHead = pHdr(pUserData);

             /* verify block type */
            _ASSERTE(_BLOCK_TYPE_IS_VALID(pHead->nBlockUse)); /*This is
where my app gets stuck*/

            _free_dbg( pUserData, pHead->nBlockUse );

            _munlock(_HEAP_LOCK);  /* release other threads */


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.

Am I using an old version of cairomm or are there any compatibility issues??

Thanks in advance
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.cairographics.org/archives/cairo/attachments/20081105/d1902832/attachment.html 

More information about the cairo mailing list