Index: tools/lua/lua_app.cpp |
diff --git a/tools/lua/lua_app.cpp b/tools/lua/lua_app.cpp |
index 6aea8ee43776a65aad26e7f227ab7b2814dfc86f..92623d0a208659ab22a53ea0870ae1f0a5acbc46 100644 |
--- a/tools/lua/lua_app.cpp |
+++ b/tools/lua/lua_app.cpp |
@@ -19,10 +19,10 @@ extern "C" { |
#include "lauxlib.h" |
} |
-static SkData* read_into_data(const char file[]) { |
- SkData* data = SkData::NewFromFileName(file); |
+static sk_sp<SkData> read_into_data(const char file[]) { |
+ sk_sp<SkData> data(SkData::MakeFromFileName(file)); |
if (!data) { |
- data = SkData::NewEmpty(); |
+ data = SkData::MakeEmpty(); |
} |
return data; |
} |
@@ -33,7 +33,7 @@ int tool_main(int argc, char** argv) { |
SkLua L; |
for (int i = 1; i < argc; ++i) { |
- SkData* data = nullptr; |
+ sk_sp<SkData> data; |
const void* ptr; |
size_t len; |
@@ -50,7 +50,6 @@ int tool_main(int argc, char** argv) { |
SkDebugf("failed to load %s\n", argv[i]); |
exit(-1); |
} |
- SkSafeUnref(data); |
} |
return 0; |
} |