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

Unified Diff: core/fpdfapi/fpdf_parser/cpdf_object.cpp

Issue 2375343004: Assert that only 0-numbered objects are Released() (Closed)
Patch Set: brute-force delete unowned numbered object in one place Created 4 years, 3 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
Index: core/fpdfapi/fpdf_parser/cpdf_object.cpp
diff --git a/core/fpdfapi/fpdf_parser/cpdf_object.cpp b/core/fpdfapi/fpdf_parser/cpdf_object.cpp
index ba7490a13f7aa1f66976fa70e80565e6f6bb823a..d74003112fe3fb94ec650ae589e085769bd58b5e 100644
--- a/core/fpdfapi/fpdf_parser/cpdf_object.cpp
+++ b/core/fpdfapi/fpdf_parser/cpdf_object.cpp
@@ -38,9 +38,7 @@ CPDF_Object* CPDF_Object::CloneNonCyclic(
}
void CPDF_Object::Release() {
- if (m_ObjNum)
- return;
-
+ CHECK(!m_ObjNum);
Lei Zhang 2016/09/30 21:44:52 So should we also CHECK(m_ObjNum != kInvalidObjNum
Tom Sepez 2016/09/30 22:21:37 That's implied by the current check.
Lei Zhang 2016/09/30 22:36:04 It is? CHECK(m_ObjNum != 0); CHECK(m_ObjNum != 0x
delete this;
}

Powered by Google App Engine
This is Rietveld 408576698