diff options
| author | Johannes Hofmann <Johannes.Hofmann@gmx.de> | 2008-07-05 21:54:21 +0200 | 
|---|---|---|
| committer | Johannes Hofmann <Johannes.Hofmann@gmx.de> | 2008-07-05 21:54:21 +0200 | 
| commit | e46af065eb2f34f123b8dd40742d2d12baccbbb5 (patch) | |
| tree | 069420ee3576fd771ddf62868d412ebf4a47513c /src | |
| parent | 29ecf5a14953471a061e5022563a6edd09d9dbef (diff) | |
TIFFOutputImage cleanup
Diffstat (limited to 'src')
| -rw-r--r-- | src/TIFFOutputImage.cxx | 25 | 
1 files changed, 10 insertions, 15 deletions
| diff --git a/src/TIFFOutputImage.cxx b/src/TIFFOutputImage.cxx index 999e05a..204bfa5 100644 --- a/src/TIFFOutputImage.cxx +++ b/src/TIFFOutputImage.cxx @@ -18,20 +18,18 @@ TIFFOutputImage::TIFFOutputImage(const char *f, int b) {  }  TIFFOutputImage::~TIFFOutputImage() { -	if (row) { +	if (row)  		free(row); -	} -	if (file) { + +	if (file)  		free(file); -	}  }  int  TIFFOutputImage::init_internal() { -	if (row) { +	if (row)  		free(row); -		row = NULL; -	} +	row = NULL;  	row = (unsigned char*) calloc((bitspersample / 8) * 4 * W, sizeof(char));  	if (!row) { @@ -39,9 +37,8 @@ TIFFOutputImage::init_internal() {  		return 1;  	} -	if (tiff) { +	if (tiff)  		TIFFClose(tiff); -	}  	if((tiff = TIFFOpen(file, "w")) == NULL){  		fprintf(stderr, "can't open %s\n", file); @@ -88,15 +85,13 @@ TIFFOutputImage::next_line_internal() {  int  TIFFOutputImage::done_internal() { -	if (tiff) { +	if (tiff)  		TIFFClose(tiff); -		tiff = NULL; -	} +	tiff = NULL; -	if (row) { +	if (row)  		free(row); -		row = NULL; -	} +	row = NULL;  	return 0;  }	 | 
