Closed kryne001 closed 10 years ago
my repository: https://github.com/kryne001/rshell
hey man, I found this helpful for the similar problem i was having http://stackoverflow.com/questions/4193982/delete-a-pointer-to-pointer-as-array-of-arrays
yeah I just read that and I thought that's what I've been doing, but anyways I changed my allocation method from malloc to new and deallocation method from free to delete and still having the same problem when trying to delete each individual index.
hmm, and you are allocating new memory for the whole array then individual index, correct?
yeah i allocate the whole array of char\ then go into a loop to allocate each index
I'm having a problem freeing my array of char**. i'm able to free the whole array without freeing each index first (which I know is wrong), but if I try to free each index, I get the following error in gdb:
malloc: * error for object 0x7fff5fbff3a9: pointer being freed was not allocated * set a breakpoint in malloc_error_break to debug
I've gone through and checked that there was indeed a value there, which there was, and I think I'm allocating the memory for each index correctly, so I don't know where I should look to fix it.