holmes4:
You therfore need to free the heap data before the pointer to goes out of scope.
Using an object doesn't imply that it owns any allocated memory. It will only own memory if it allocated it, or it was given it. In either case, the usual rules of memory management would apply and when it was destroyed the object would be responsible for releasing any memory that it owned. I think you're implying that objects inherently or commonly use heap memory and that users of those objects need to deal with that specially, and I don't think that's the case.