shared pointers, still having memory leaks.

I really need to learn more about how c++ handles memory.