Skip to content
Tcl Source Code View Ticket
Login

View Ticket

2002-04-10
02:18 • Closed ticket [541560ffff]: Memory Leaks on invalid syntax plus 7 other chan... artifact: 021e88700a user: hobbs
2002-04-09
14:23 • New ticket [541560ffff]. artifact: 96b8e5ccab user: deech

Memory Leaks on invalid syntax

Closed / Invalid541560ffffffffffffffffffffffffffffffffffCreated 25 years agoUpdated 25 years ago
Descriptionplain2002-04-09 14:23:15
-Using tcl8.4 (earlier release I think it's 8.4a)
-Windows 2000 5.00.2195 SP2
-Memory appears to leak when interpreter is given 
invalid syntax scripts.

#include "Interpreter.h"
#include <windows.h>

int main(int argc, char* argv[])
{
    Tcl_FindExecutable(argv[0]);

    while(1)
    {
        Tcl_Interp* pInterp = Tcl_CreateInterp();
        Tcl_Init(pInterp); 

        Tcl_Obj *Tcl_ObjPtr = Tcl_NewUnicodeObj
(L"invalid syntax", 8);
        Tcl_EvalObjEx(pInterp, Tcl_ObjPtr, NULL );


        Tcl_DeleteInterp(pInterp); 
        Sleep(100);
    }
return 0;
}
hobbsplain2002-04-10 02:18:01
Logged In: YES 
user_id=72656

Well, what sort of leak you are referring to wasn't 
mentioned.  The first CreateInterp will create several 
structures that won't go away until Tcl_Finalize.  Also, 
you are definitely leaking the UnicodeObj by not doing and 
incr/decr of the ref count.
Log in (anonymous is fine) to add a comment.