skia2/dm
John Stiles 33e044fb16 Prevent non-trivial destructors from running after exit in DM.
Previously, DM destroyed a large number of non-trivial objects at
shutdown time. Because no shutdown order is promised across translation
units by the standard, this can lead to bugs which only reproduce
capriciously, at the whim of the linker.

http://go/totw/110#the-fix-safe-initialization-no-destruction

"Destruction issues are usually solved by defining your static data
in such a way that the destructor never runs. The most common way to do
this is to heap allocate the static object - pointers don't have
destructors."

http://go/cstyle#decision_on_destruction

"Global and static variables that use dynamic initialization or have
non-trivial destructors create complexity that can easily lead to hard-
to-find bugs. Dynamic initialization is not ordered across translation
units, and neither is destruction (except that destruction happens in
reverse order of initialization). When one initialization refers to
another variable with static storage duration, it is possible that this
causes an object to be accessed before its lifetime has begun (or
after its lifetime has ended). Moreover, when a program starts threads
that are not joined at exit, those threads may attempt to access objects
after their lifetime has ended if their destructor has already run."

Change-Id: I54eedcd813295a23923deb925b0ca2adfff69f7d
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/297872
Auto-Submit: John Stiles <johnstiles@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
Reviewed-by: Mike Klein <mtklein@google.com>
2020-06-20 00:02:23 +00:00
..
DM.cpp Prevent non-trivial destructors from running after exit in DM. 2020-06-20 00:02:23 +00:00
DMGpuTestProcs.cpp Implement flush finish proc support for d3d backend. 2020-06-19 16:28:33 +00:00
DMJsonWriter.cpp Remove all global mutexes 2019-06-18 00:39:15 +00:00
DMJsonWriter.h rewrite includes to not need so much -Ifoo 2019-04-24 16:27:11 +00:00
DMSrcSink.cpp Fix flippity GM for *ooprddl configs (take 2) 2020-06-19 14:47:53 +00:00
DMSrcSink.h Add GM::gpuSetup step 2020-06-16 18:31:55 +00:00