malloc: *** error for object: pointer being freed was not allocated *** set a breakpoint in malloc_error_break to debug
问题 Can someone help me figure out where I'm getting this error. I know it's probably a double deletion or something like this. For the background this is an implementation of the huffman's tree as you can easily realize on wikipedia. CharCountNode class implementation int main() { ifstream input; input.open("input.txt"); MinPriorityQueue<CharCountNode> heap; map<char, int> m; while(input.good()) m[input.get()] += 1; for( map<char, int>::const_iterator it = m.begin(); it != m.end(); ++it ) heap