Csound Csound-dev Csound-tekno Search About

[Csnd] API: GetSpout(), GetSpin()

Date2012-06-18 17:37
FromRory Walsh
Subject[Csnd] API: GetSpout(), GetSpin()
Hopefully someone can offer some help on this issue but Cabbage is
crashing on exit since I updated my version of Csound. My constructor
has the following:

csound->PerformKsmps();
CSspout = csound->GetSpout();
CSspin  = csound->GetSpin();

where CSspout and CSspin are scoped pointers of type MYFLT.

I make no more calls to any Csound functions. But as soon as I exit I
get an assertion and my debugger takes me to dbgdel.cpp and the
following function(you can see the line producing the assertion):

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

        RTCCALLBACK(_RTC_Free_hook, (pUserData, 0));

        if (pUserData == NULL)
            return;

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

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

             /* verify block type */
            _ASSERTE(_BLOCK_TYPE_IS_VALID(pHead->nBlockUse));

            _free_dbg( pUserData, pHead->nBlockUse );

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

        return;
}

If I remove the calls to GetSpout() and GetSpin() in my destructor
everything exits perfectly. My feeling is that my two MYFLT pointers
are not being deleted, or can't be deleted. I just don't know why. Any
ideas?