Skip to content

Commit 0f61bed

Browse files
author
Sol
committed
Thanks wicked for your suggestion.
1 parent 0ab2baa commit 0f61bed

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

image_processing/ppm_04.cpp

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -203,8 +203,11 @@ void tst(ppm *image, ppm *image2,int left,int right){
203203
int main(){
204204
std::string fname=std::string("your_file_name.ppm");
205205

206-
ppm *image = new ppm(fname);
207-
ppm *image2 = new ppm(image->width,image->height);
206+
ppm aux(fname);
207+
ppm aux2(aux.width,aux.height);
208+
ppm *image = &aux;
209+
ppm *image2 = &aux2;
210+
208211
//Number of threads to use (the image will be divided between threads)
209212
int parts = 8;
210213

@@ -236,8 +239,6 @@ int main(){
236239

237240
//Clear memory and exit
238241
delete [] tt;
239-
delete image;
240-
delete image2;
241-
242+
242243
return(0);
243244
}

0 commit comments

Comments
 (0)