| | @@ -323,37 +323,10 @@ |
| 323 | 323 | |
| 324 | 324 | #endif |
| 325 | 325 | |
| 326 | 326 | Global g; |
| 327 | 327 | |
| 328 | | -/* |
| 329 | | -** Infrastructure for fossil_atexit_free_this(). |
| 330 | | -*/ |
| 331 | | -static struct { |
| 332 | | - void* list[20]; /* Pointers to pass to fossil_free() during |
| 333 | | - ** atexit(). */ |
| 334 | | - int n; /* Number of items currently in this->list. */ |
| 335 | | -} fossilFreeAtExit = { {0}, 0 }; |
| 336 | | - |
| 337 | | -/* |
| 338 | | -** If zMem is not NULL and there is space in fossil's atexit cleanup |
| 339 | | -** queue, zMem is added to that queue so that it will be passed to |
| 340 | | -** fossil_free() during the atexit() phase of app shutdown. If the |
| 341 | | -** queue is full or zMem is NULL, this function has no side effects. |
| 342 | | -** |
| 343 | | -** This is intended to be called by routines which allocate heap |
| 344 | | -** memory for static-scope values which otherwise won't be freed, and |
| 345 | | -** the static queue size is relatively small. |
| 346 | | -*/ |
| 347 | | -void fossil_atexit_free_this(void * zMem){ |
| 348 | | - if(zMem!=0 |
| 349 | | - && fossilFreeAtExit.n < (sizeof(fossilFreeAtExit.list) |
| 350 | | - / sizeof(fossilFreeAtExit.list[0]))){ |
| 351 | | - fossilFreeAtExit.list[fossilFreeAtExit.n++] = zMem; |
| 352 | | - } |
| 353 | | -} |
| 354 | | - |
| 355 | 328 | /* |
| 356 | 329 | ** atexit() handler which frees up "some" of the resources |
| 357 | 330 | ** used by fossil. |
| 358 | 331 | */ |
| 359 | 332 | static void fossil_atexit(void) { |
| | @@ -393,18 +366,10 @@ |
| 393 | 366 | db_close(0); |
| 394 | 367 | } |
| 395 | 368 | manifest_clear_cache(); |
| 396 | 369 | content_clear_cache(1); |
| 397 | 370 | rebuild_clear_cache(); |
| 398 | | - if(fossilFreeAtExit.n>0){ |
| 399 | | - int i; |
| 400 | | - for(i = 0; i < fossilFreeAtExit.n; ++i){ |
| 401 | | - fossil_free(fossilFreeAtExit.list[i]); |
| 402 | | - fossilFreeAtExit.list[i] = 0; |
| 403 | | - } |
| 404 | | - fossilFreeAtExit.n = 0; |
| 405 | | - } |
| 406 | 371 | /* |
| 407 | 372 | ** FIXME: The next two lines cannot always be enabled; however, they |
| 408 | 373 | ** are very useful for tracking down TH1 memory leaks. |
| 409 | 374 | */ |
| 410 | 375 | if( fossil_getenv("TH1_DELETE_INTERP")!=0 ){ |
| 411 | 376 | |