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

Unified Diff: src/core/SkLazyPtr.h

Issue 606013004: Stop doing at-exit cleanup of lazy pointers. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: re-rebase Created 6 years, 2 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: src/core/SkLazyPtr.h
diff --git a/src/core/SkLazyPtr.h b/src/core/SkLazyPtr.h
index 0612327dab4073226b2725fc137b307dceef067f..594112f6aca367af95580c9d619b22690728def3 100644
--- a/src/core/SkLazyPtr.h
+++ b/src/core/SkLazyPtr.h
@@ -41,8 +41,6 @@
*
* You can think of SK_DECLARE_STATIC_LAZY_PTR as a cheaper specialization of
* SkOnce. There is no mutex or extra storage used past the pointer itself.
- * In debug mode, each lazy pointer will be cleaned up at process exit so we
- * can check that we've not leaked or freed them early.
*
* We may call Create more than once, but all threads will see the same pointer
* returned from get(). Any extra calls to Create will be cleaned up.
@@ -114,17 +112,6 @@ public:
return ptr ? ptr : try_cas<T*, Destroy>(&fPtr, Create());
}
-#ifdef SK_DEVELOPER
- // FIXME: We know we leak refs on some classes. For now, let them leak.
- void cleanup(SkFontConfigInterfaceDirect*) {}
- template <typename U> void cleanup(U* ptr) { Destroy(ptr); }
-
- ~SkLazyPtr() {
- this->cleanup((T*)fPtr);
- fPtr = NULL;
- }
-#endif
-
private:
void* fPtr;
};
@@ -143,15 +130,6 @@ public:
return ptr ? ptr : try_cas<T*, Destroy>(&fArray[i], Create(i));
}
-#ifdef SK_DEVELOPER
- ~SkLazyPtrArray() {
- for (int i = 0; i < N; i++) {
- Destroy((T*)fArray[i]);
- fArray[i] = NULL;
- }
- }
-#endif
-
private:
void* fArray[N];
};
« 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