> As for the memory leak, I do not quite understand you.
> It's not pointing to anything before it calls objectB.get,
> and is empty after the constructor of ClassA is used. Where is the error?
It is pointing to something. in the constructor you do
this->objectA=new list<string*>*;
, that the list does not have any elements is irrelevant you have reserved memory for the list.
run your program through valgrind
> What I did notice (and also noticed, didn't write here) is that objectB is declared twice
> once in methodA, and another in the private part of ClassA.
it is not declared twice, those are two different objects
I'll insist, please provide a testcase
http://www.eelis.net/iso-c++/testcase.xhtml it should show how your class are defined and how they are used.
> If I eliminate either, the program compiles, runs, and crashes.
http://www.cplusplus.com/forum/general/112111/
> "list" is a class written by us
¿are you sure that that works? ¿would it be too much trouble to replace it with
std::list?
> See this, maybe it'll give you a better idea of what I am aiming to do:
Ni por asomo. O bien la solución me parece trivial, o bien no entendí el problema.
Tampoco entiendo por qué utilizar una image cuando simplemente podrías escribir el pseudocódigo.
(TN: No, it doesn't help)