+2  A: 

gfx points to an object in stack. Are you sure that the object is still there (at the same position where it was) when you are trying to draw?

Tronic
This is a good point. How can I put this object on the heap since there's no clone() function available?
the_gastropod
Allocate it by operator new, or put it inside some object that is allocated from heap.
Tronic
+2  A: 

It's bad practice to store pointer to argument given to you as a reference - this creates confusion about memory ownership. Either make a copy of the referenced object (if it's a value class), or change the method to take smart pointer (like boost::shared_ptr) to the shared resource. This way the resource ownership management is explicit.

To your immediate issue - the Graphics instance is probably allocated on the stack and goes out of scope, thus destructed. Then your Picture code references dead object.

Nikolai N Fetissov