detach -> release
The C++ standard library uses the name "release" for the operation we call "detach".
Rewriting each "detach(" to "release(" brings us a step closer to using standard library types directly (e.g. std::unique_ptr instead of SkAutoTDelete).
This was a fairly blind transformation. There may have been unintentional conversions in here, but it's probably for the best to have everything uniformly say "release".
BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1809733002
Review URL: https://codereview.chromium.org/1809733002
diff --git a/src/codec/SkCodec.cpp b/src/codec/SkCodec.cpp
index c8de73c..fc57e94 100644
--- a/src/codec/SkCodec.cpp
+++ b/src/codec/SkCodec.cpp
@@ -88,19 +88,19 @@
// But this code follows the same pattern as the loop.
#ifdef SK_CODEC_DECODES_PNG
if (SkPngCodec::IsPng(buffer, bytesRead)) {
- return SkPngCodec::NewFromStream(streamDeleter.detach(), chunkReader);
+ return SkPngCodec::NewFromStream(streamDeleter.release(), chunkReader);
} else
#endif
{
for (DecoderProc proc : gDecoderProcs) {
if (proc.IsFormat(buffer, bytesRead)) {
- return proc.NewFromStream(streamDeleter.detach());
+ return proc.NewFromStream(streamDeleter.release());
}
}
#ifdef SK_CODEC_DECODES_RAW
// Try to treat the input as RAW if all the other checks failed.
- return SkRawCodec::NewFromStream(streamDeleter.detach());
+ return SkRawCodec::NewFromStream(streamDeleter.release());
#endif
}