Project

General

Profile

lighttpd-fix-shutdown-leaks.diff

peto, 2008-10-31 01:52

View differences:

chunk.c (working copy)
167 167
	if (!chunkpool) return;
168 168

  
169 169
	/* free the pool */
170
	while(chunkpool) {
171
		chunk *c = chunkpool->next;
172
		chunk_free(chunkpool);
173
		chunkpool = c;
174
	}
175

  
176
	chunkpool_chunks = 0;
170 177
}
171 178

  
172 179
static chunk *chunkpool_get_unused_chunk(void) {
chunk.h (working copy)
56 56
	off_t  bytes_in, bytes_out;
57 57
} chunkqueue;
58 58

  
59
LI_API void chunkpool_free(void);
60

  
59 61
LI_API chunkqueue* chunkqueue_init(void);
60 62
LI_API int chunkqueue_set_tempdirs(chunkqueue *c, array *tempdirs);
61 63
LI_API int chunkqueue_append_file(chunkqueue *c, buffer *fn, off_t offset, off_t len);
server.c (working copy)
1807 1813
		free(srv->posix_aio_iocbs);
1808 1814
	}
1809 1815
#endif
1810
	if (srv->network_backend == NETWORK_BACKEND_GTHREAD_AIO) {
1816
	if (aio_write_threads != NULL) {
1811 1817
		for (i = 0; i < srv->srvconf.max_read_threads; i++) {
1812 1818
			g_thread_join(aio_write_threads[i]);
1813 1819
		}
......
1868 1874
	free(stat_cache_threads);
1869 1875
#endif
1870 1876

  
1877
	chunkpool_free();
1878

  
1871 1879
	return 0;
1872 1880
}