Fossil SCM
Enable use of the TH1_DELETE_INTERP environment variable to delete the TH1 interp on exit.
Commit
e0f22dda7b25cd992f3f1a09acb23ef89e5f7eb6
Parent
fb29094a8f9ea09…
2 files changed
+6
-5
+2
-1
+6
-5
| --- src/main.c | ||
| +++ src/main.c | ||
| @@ -378,17 +378,18 @@ | ||
| 378 | 378 | if(g.db){ |
| 379 | 379 | db_close(0); |
| 380 | 380 | } |
| 381 | 381 | /* |
| 382 | 382 | ** FIXME: The next two lines cannot always be enabled; however, they |
| 383 | - ** are useful for tracking down TH1 memory leaks. | |
| 383 | + ** are very useful for tracking down TH1 memory leaks. | |
| 384 | 384 | */ |
| 385 | - /* | |
| 386 | - if( g.interp ){ | |
| 387 | - Th_DeleteInterp(g.interp); g.interp = 0; | |
| 385 | + if( fossil_getenv("TH1_DELETE_INTERP")!=0 ){ | |
| 386 | + if( g.interp ){ | |
| 387 | + Th_DeleteInterp(g.interp); g.interp = 0; | |
| 388 | + } | |
| 389 | + assert( Th_GetOutstandingMalloc()==0 ); | |
| 388 | 390 | } |
| 389 | - assert( Th_GetOutstandingMalloc()==0 ); */ | |
| 390 | 391 | } |
| 391 | 392 | |
| 392 | 393 | /* |
| 393 | 394 | ** Convert all arguments from mbcs (or unicode) to UTF-8. Then |
| 394 | 395 | ** search g.argv for arguments "--args FILENAME". If found, then |
| 395 | 396 |
| --- src/main.c | |
| +++ src/main.c | |
| @@ -378,17 +378,18 @@ | |
| 378 | if(g.db){ |
| 379 | db_close(0); |
| 380 | } |
| 381 | /* |
| 382 | ** FIXME: The next two lines cannot always be enabled; however, they |
| 383 | ** are useful for tracking down TH1 memory leaks. |
| 384 | */ |
| 385 | /* |
| 386 | if( g.interp ){ |
| 387 | Th_DeleteInterp(g.interp); g.interp = 0; |
| 388 | } |
| 389 | assert( Th_GetOutstandingMalloc()==0 ); */ |
| 390 | } |
| 391 | |
| 392 | /* |
| 393 | ** Convert all arguments from mbcs (or unicode) to UTF-8. Then |
| 394 | ** search g.argv for arguments "--args FILENAME". If found, then |
| 395 |
| --- src/main.c | |
| +++ src/main.c | |
| @@ -378,17 +378,18 @@ | |
| 378 | if(g.db){ |
| 379 | db_close(0); |
| 380 | } |
| 381 | /* |
| 382 | ** FIXME: The next two lines cannot always be enabled; however, they |
| 383 | ** are very useful for tracking down TH1 memory leaks. |
| 384 | */ |
| 385 | if( fossil_getenv("TH1_DELETE_INTERP")!=0 ){ |
| 386 | if( g.interp ){ |
| 387 | Th_DeleteInterp(g.interp); g.interp = 0; |
| 388 | } |
| 389 | assert( Th_GetOutstandingMalloc()==0 ); |
| 390 | } |
| 391 | } |
| 392 | |
| 393 | /* |
| 394 | ** Convert all arguments from mbcs (or unicode) to UTF-8. Then |
| 395 | ** search g.argv for arguments "--args FILENAME". If found, then |
| 396 |
+2
-1
| --- src/th_main.c | ||
| +++ src/th_main.c | ||
| @@ -1011,11 +1011,12 @@ | ||
| 1011 | 1011 | } |
| 1012 | 1012 | if( forceReset || created ){ |
| 1013 | 1013 | th_register_language(g.interp); /* Basic scripting commands. */ |
| 1014 | 1014 | } |
| 1015 | 1015 | #ifdef FOSSIL_ENABLE_TCL |
| 1016 | - if( forceTcl || getenv("TH1_ENABLE_TCL")!=0 || db_get_boolean("tcl", 0) ){ | |
| 1016 | + if( forceTcl || fossil_getenv("TH1_ENABLE_TCL")!=0 || | |
| 1017 | + db_get_boolean("tcl", 0) ){ | |
| 1017 | 1018 | if( !g.tcl.setup ){ |
| 1018 | 1019 | g.tcl.setup = db_get("tcl-setup", 0); /* Grab Tcl setup script. */ |
| 1019 | 1020 | } |
| 1020 | 1021 | th_register_tcl(g.interp, &g.tcl); /* Tcl integration commands. */ |
| 1021 | 1022 | } |
| 1022 | 1023 |
| --- src/th_main.c | |
| +++ src/th_main.c | |
| @@ -1011,11 +1011,12 @@ | |
| 1011 | } |
| 1012 | if( forceReset || created ){ |
| 1013 | th_register_language(g.interp); /* Basic scripting commands. */ |
| 1014 | } |
| 1015 | #ifdef FOSSIL_ENABLE_TCL |
| 1016 | if( forceTcl || getenv("TH1_ENABLE_TCL")!=0 || db_get_boolean("tcl", 0) ){ |
| 1017 | if( !g.tcl.setup ){ |
| 1018 | g.tcl.setup = db_get("tcl-setup", 0); /* Grab Tcl setup script. */ |
| 1019 | } |
| 1020 | th_register_tcl(g.interp, &g.tcl); /* Tcl integration commands. */ |
| 1021 | } |
| 1022 |
| --- src/th_main.c | |
| +++ src/th_main.c | |
| @@ -1011,11 +1011,12 @@ | |
| 1011 | } |
| 1012 | if( forceReset || created ){ |
| 1013 | th_register_language(g.interp); /* Basic scripting commands. */ |
| 1014 | } |
| 1015 | #ifdef FOSSIL_ENABLE_TCL |
| 1016 | if( forceTcl || fossil_getenv("TH1_ENABLE_TCL")!=0 || |
| 1017 | db_get_boolean("tcl", 0) ){ |
| 1018 | if( !g.tcl.setup ){ |
| 1019 | g.tcl.setup = db_get("tcl-setup", 0); /* Grab Tcl setup script. */ |
| 1020 | } |
| 1021 | th_register_tcl(g.interp, &g.tcl); /* Tcl integration commands. */ |
| 1022 | } |
| 1023 |