diff options
author | Derek Sollenberger <djsollen@google.com> | 2011-08-08 12:44:47 -0700 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2011-08-08 12:44:47 -0700 |
commit | 3163fe518b66d1734da1fd7aa94da2d4450afdee (patch) | |
tree | 362bbea844b51c569eb810e64123cc69bf962897 /Source | |
parent | bdeccf99cf5f7ca1106da76c202eb82859f753f6 (diff) | |
parent | da141e6dd5b22d57092eb5bbbeef6ea5e9d28430 (diff) | |
download | external_webkit-3163fe518b66d1734da1fd7aa94da2d4450afdee.zip external_webkit-3163fe518b66d1734da1fd7aa94da2d4450afdee.tar.gz external_webkit-3163fe518b66d1734da1fd7aa94da2d4450afdee.tar.bz2 |
Merge "Fix memory leak in WebKit's NinePatch code."
Diffstat (limited to 'Source')
-rw-r--r-- | Source/WebKit/android/RenderSkinNinePatch.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/Source/WebKit/android/RenderSkinNinePatch.cpp b/Source/WebKit/android/RenderSkinNinePatch.cpp index 0c915c0..074a65a 100644 --- a/Source/WebKit/android/RenderSkinNinePatch.cpp +++ b/Source/WebKit/android/RenderSkinNinePatch.cpp @@ -48,8 +48,8 @@ bool RenderSkinNinePatch::decodeAsset(AssetManager* am, const char* filename, Ni SkImageDecoder::Mode mode = SkImageDecoder::kDecodePixels_Mode; SkBitmap::Config prefConfig = SkBitmap::kNo_Config; - SkStream* stream = new SkMemoryStream(asset->getBuffer(false), asset->getLength()); - SkImageDecoder* decoder = SkImageDecoder::Factory(stream); + SkMemoryStream stream(asset->getBuffer(false), asset->getLength()); + SkImageDecoder* decoder = SkImageDecoder::Factory(&stream); if (!decoder) { asset->close(); LOGE("RenderSkinNinePatch::Failed to create an image decoder"); @@ -65,7 +65,7 @@ bool RenderSkinNinePatch::decodeAsset(AssetManager* am, const char* filename, Ni SkAutoTDelete<SkImageDecoder> add(decoder); decoder->setPeeker(&peeker); - if (!decoder->decode(stream, &ninepatch->m_bitmap, prefConfig, mode, true)) { + if (!decoder->decode(&stream, &ninepatch->m_bitmap, prefConfig, mode, true)) { asset->close(); LOGE("RenderSkinNinePatch::Failed to decode nine patch asset"); return false; |