src/oldpool.cpp
branchNewGRF_ports
changeset 6800 6c09e1e86fcb
parent 6743 cabfaa4a0295
child 6872 1c4a4a609f85
equal deleted inserted replaced
6799:2adc1052a548 6800:6c09e1e86fcb
    16 {
    16 {
    17 	uint i;
    17 	uint i;
    18 
    18 
    19 	DEBUG(misc, 4, "[Pool] (%s) cleaning pool..", this->name);
    19 	DEBUG(misc, 4, "[Pool] (%s) cleaning pool..", this->name);
    20 
    20 
       
    21 	this->cleaning_pool = true;
    21 	/* Free all blocks */
    22 	/* Free all blocks */
    22 	for (i = 0; i < this->current_blocks; i++) {
    23 	for (i = 0; i < this->current_blocks; i++) {
    23 		if (this->clean_block_proc != NULL) {
    24 		if (this->clean_block_proc != NULL) {
    24 			this->clean_block_proc(i * (1 << this->block_size_bits), (i + 1) * (1 << this->block_size_bits) - 1);
    25 			this->clean_block_proc(i * (1 << this->block_size_bits), (i + 1) * (1 << this->block_size_bits) - 1);
    25 		}
    26 		}
    26 		free(this->blocks[i]);
    27 		free(this->blocks[i]);
    27 	}
    28 	}
       
    29 	this->cleaning_pool = false;
    28 
    30 
    29 	/* Free the block itself */
    31 	/* Free the block itself */
    30 	free(this->blocks);
    32 	free(this->blocks);
    31 
    33 
    32 	/* Clear up some critical data */
    34 	/* Clear up some critical data */