Updated table.cpp with possible memory leak resolution.