>
> Sorry, I was using wrong version of com.dll, so ref counting releasing not 
> happening at all.  Tests continue....
>

OK, if you find any issues, can you add a debugging trace function like this:

#define VEC_DEBUG
#ifdef VEC_DEBUG

static void DoTrace(LPSTR msg, int vi)
{
        if (g_Verbose)
        {
                char sz[300];
                char szline[MAX_PATH+1];
                char szexpr[MAX_PATH+1];
                strcpy(szexpr, "scriptline");
                g_ppsv->EvalExpr(szexpr, szline);
                wsprintf(sz, "Line %s : %s %i %s %i %s %i %s %i %s %i", szline, 
"vec", vi+1, "len",
                        g_v[vi].length, "refs", g_v[vi].refcount,
                        "nAlloc", g_nAlloc, "lastalloc", g_lastAlloc);
                g_ppsv->Debug(msg,sz,"","","","");
        }
}
#define Trace(msg, ivar) DoTrace((msg), (ivar))
#else
#define Trace(msg, ivar) 
#endif


and then include code like this in your refcalback
static void AddRef(LPSTR sz, BOOL bAdd)
{
        int vi;
        if ( (vi=Validate(sz,g_ppsv)) >=0)
        {
                if (bAdd)
                {
                        g_v[vi].refcount++;
                        Trace(">>>>>ref count after increment", vi);
                }
                else if (!g_v[vi].refcount)
                {
                        Trace(">>>>>free temp vec", vi);
                        FreeVec(vi);

                }

        }
                

}
and similar trace code in routine that processes free calls.  Also need a new 
service com.verbose(arg) to set g_Verbose to integer value of arg.


Reply via email to