glviewvol

diff src/volume.cc @ 3:32c4a7160350

den kanei kryo stin ellada
author John Tsiombikas <nuclear@member.fsf.org>
date Sun, 28 Dec 2014 21:48:15 +0200
parents 701507c8238f
children 04330eb80b36
line diff
     1.1 --- a/src/volume.cc	Sun Dec 28 15:26:36 2014 +0200
     1.2 +++ b/src/volume.cc	Sun Dec 28 21:48:15 2014 +0200
     1.3 @@ -79,8 +79,17 @@
     1.4  	size[0] = size[1] = size[2] = 0;
     1.5  }
     1.6  
     1.7 +VoxelVolume::~VoxelVolume()
     1.8 +{
     1.9 +	for(size_t i=0; i<slices.size(); i++) {
    1.10 +		slices[i].destroy();
    1.11 +	}
    1.12 +}
    1.13 +
    1.14  bool VoxelVolume::load(const char *fname)
    1.15  {
    1.16 +	if(!fname) return false;
    1.17 +
    1.18  	char *prefix = (char*)alloca(strlen(fname) + 1);
    1.19  	strcpy(prefix, fname);
    1.20  	char *slash = strrchr(prefix, '/');
    1.21 @@ -120,7 +129,6 @@
    1.22  		}
    1.23  
    1.24  		slices.push_back(img);
    1.25 -		img.pixels = 0;	// otherwise the destructor will free it
    1.26  	}
    1.27  
    1.28  	size[2] = slices.size();