aboutsummaryrefslogtreecommitdiffhomepage
path: root/include/core/SkStream.h
diff options
context:
space:
mode:
authorGravatar Hal Canary <halcanary@skia.org>2017-08-26 19:31:12 -0400
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2017-08-28 20:36:07 +0000
commit4b972d1db329e257657da4bda8de7b7a97d7acbb (patch)
tree3ce68d1247bd98851a1c4364971b07995e74c118 /include/core/SkStream.h
parent3416969605137214a9e1b1fb85182e5640a655ab (diff)
SkFILEStream::Make: fix leak.
Change-Id: I218ae89f049df3d05380b46ca672bb1f6fcb5ea4 Reviewed-on: https://skia-review.googlesource.com/38962 Commit-Queue: Ben Wagner <bungeman@google.com> Reviewed-by: Ben Wagner <bungeman@google.com>
Diffstat (limited to 'include/core/SkStream.h')
-rw-r--r--include/core/SkStream.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/include/core/SkStream.h b/include/core/SkStream.h
index fde6baf0c9..5ef8519245 100644
--- a/include/core/SkStream.h
+++ b/include/core/SkStream.h
@@ -264,8 +264,8 @@ public:
~SkFILEStream() override;
static std::unique_ptr<SkFILEStream> Make(const char path[]) {
- SkFILEStream* stream = new SkFILEStream(path);
- return stream->isValid() ? std::unique_ptr<SkFILEStream>(stream) : nullptr;
+ std::unique_ptr<SkFILEStream> stream(new SkFILEStream(path));
+ return stream->isValid() ? std::move(stream) : nullptr;
}
/** Returns true if the current path could be opened. */