Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1366)

Unified Diff: base/mac/objc_property_releaser.mm

Issue 1961013002: DCHECK when an ObjCPropertyReleaser has no properties to release. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/mac/objc_property_releaser.mm
diff --git a/base/mac/objc_property_releaser.mm b/base/mac/objc_property_releaser.mm
index f7ee88fbcc4dd0e4c8d7b7ce95d9030021042324..b156ddc64d1d49dc4044a8f5f5419d9e0fb437d8 100644
--- a/base/mac/objc_property_releaser.mm
+++ b/base/mac/objc_property_releaser.mm
@@ -104,6 +104,7 @@ void ObjCPropertyReleaser::ReleaseProperties() {
unsigned int property_count = 0;
objc_property_t* properties = class_copyPropertyList(class_, &property_count);
+ bool released_something = false;
for (unsigned int property_index = 0;
property_index < property_count;
++property_index) {
@@ -116,9 +117,13 @@ void ObjCPropertyReleaser::ReleaseProperties() {
(void**)&instance_value);
DCHECK(instance_variable);
[instance_value release];
+ released_something = true;
}
}
+ // Check that this property releaser was of some use.
+ DCHECK(released_something);
+
free(properties);
// Clear object_ and class_ in case this ObjCPropertyReleaser will live on.
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698