aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--objectivec/GPBMessage.h5
-rw-r--r--src/google/protobuf/stubs/shared_ptr.h7
2 files changed, 9 insertions, 3 deletions
diff --git a/objectivec/GPBMessage.h b/objectivec/GPBMessage.h
index c07ec888..2c325ba8 100644
--- a/objectivec/GPBMessage.h
+++ b/objectivec/GPBMessage.h
@@ -66,6 +66,11 @@ CF_EXTERN_C_END
/**
* Base class that each generated message subclasses from.
*
+ * @note @c NSCopying support is a "deep copy", in that all sub objects are
+ * copied. Just like you wouldn't want a UIView/NSView trying to
+ * exist in two places, you don't want a sub message to be a property
+ * property of two other messages.
+ *
* @note While the class support NSSecureCoding, if the message has any
* extensions, they will end up reloaded in @c unknownFields as there is
* no way for the @c NSCoding plumbing to pass through a
diff --git a/src/google/protobuf/stubs/shared_ptr.h b/src/google/protobuf/stubs/shared_ptr.h
index d250bf4d..7da114e9 100644
--- a/src/google/protobuf/stubs/shared_ptr.h
+++ b/src/google/protobuf/stubs/shared_ptr.h
@@ -428,11 +428,11 @@ class enable_shared_from_this {
shared_ptr<T> shared_from_this() {
// Behavior is undefined if the precondition isn't satisfied; we choose
// to die with a CHECK failure.
- CHECK(!weak_this_.expired()) << "No shared_ptr owns this object";
+ GOOGLE_CHECK(!weak_this_.expired()) << "No shared_ptr owns this object";
return weak_this_.lock();
}
shared_ptr<const T> shared_from_this() const {
- CHECK(!weak_this_.expired()) << "No shared_ptr owns this object";
+ GOOGLE_CHECK(!weak_this_.expired()) << "No shared_ptr owns this object";
return weak_this_.lock();
}
@@ -456,7 +456,8 @@ class enable_shared_from_this {
template<typename T>
void shared_ptr<T>::MaybeSetupWeakThis(enable_shared_from_this<T>* ptr) {
if (ptr) {
- CHECK(ptr->weak_this_.expired()) << "Object already owned by a shared_ptr";
+ GOOGLE_CHECK(ptr->weak_this_.expired())
+ << "Object already owned by a shared_ptr";
ptr->weak_this_ = *this;
}
}