Fossil SCM

Enable use of the TH1_DELETE_INTERP environment variable to delete the TH1 interp on exit.

mistachkin 2014-01-14 09:48 trunk
Commit e0f22dda7b25cd992f3f1a09acb23ef89e5f7eb6
2 files changed +6 -5 +2 -1
+6 -5
--- src/main.c
+++ src/main.c
@@ -378,17 +378,18 @@
378378
if(g.db){
379379
db_close(0);
380380
}
381381
/*
382382
** 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.
384384
*/
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 );
388390
}
389
- assert( Th_GetOutstandingMalloc()==0 ); */
390391
}
391392
392393
/*
393394
** Convert all arguments from mbcs (or unicode) to UTF-8. Then
394395
** search g.argv for arguments "--args FILENAME". If found, then
395396
--- 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 @@
10111011
}
10121012
if( forceReset || created ){
10131013
th_register_language(g.interp); /* Basic scripting commands. */
10141014
}
10151015
#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) ){
10171018
if( !g.tcl.setup ){
10181019
g.tcl.setup = db_get("tcl-setup", 0); /* Grab Tcl setup script. */
10191020
}
10201021
th_register_tcl(g.interp, &g.tcl); /* Tcl integration commands. */
10211022
}
10221023
--- 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

Keyboard Shortcuts

Open search /
Next entry (timeline) j
Previous entry (timeline) k
Open focused entry Enter
Show this help ?
Toggle theme Top nav button