Author: Stan Eisenstat
Subject: Re: [Cs223] DestroyD
Date: Tuesday, 31 Mar 2020, 13:05:28
> Message Posted By: Unknown > > Based on your last response, if we don't free(line) where line is the char > * being inputted into remD (inside of our destroyD function), won't there > be valgrind errors due to unfreeze memory once we destroy the deque? The > way I have it now overrides the same char * each time I call remD from > destroyD. Yes, the storage will be lost and valgrind will report it as such. However, since the only blocks of allocated storage being added to or pushed on the Deques are lines read from files, and since all of these lines must be removed and printed once they are sorted, Qsort should only be calling destroyD() on empty Deques. --Stan-PREV INDEX NEXT