On Tue, Dec 10, 2002 at 12:34:48PM -0500, Matthew Cross wrote: > The HexEncoder is trying to delete the PrivateNullSink here and throwing > fits. What's wrong?
You have to allocate PrivateNullSink from the heap rather than on the stack. From Readme.txt: 1. If a constructor for A takes a pointer to an object B (except primitive types such as int and char), then A owns B and will delete B at A's destruction. If a constructor for A takes a reference to an object B, then the caller retains ownership of B and should not destroy it until A no longer needs it. > Is it better to just create the HexEncoder, use it, then alloc > MaxRetrievable() and Get() the data into my buffer? That works too but may involve more memory allocation/deallocation.
