diff options
Diffstat (limited to 'WebCore/platform/graphics/android/TextureOwner.cpp')
-rw-r--r-- | WebCore/platform/graphics/android/TextureOwner.cpp | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/WebCore/platform/graphics/android/TextureOwner.cpp b/WebCore/platform/graphics/android/TextureOwner.cpp index 6a6845a..c4446d7 100644 --- a/WebCore/platform/graphics/android/TextureOwner.cpp +++ b/WebCore/platform/graphics/android/TextureOwner.cpp @@ -34,8 +34,11 @@ TextureOwner::~TextureOwner() { if (m_ownedTextures.size()) { // This TextureOwner owns textures still! - HashSet<BackedDoubleBufferedTexture*>::iterator it = m_ownedTextures.begin(); - for (; it != m_ownedTextures.end(); ++it) + HashSet<BackedDoubleBufferedTexture*> textures; + // Swap to a local copy because release will modify the iterator. + textures.swap(m_ownedTextures); + HashSet<BackedDoubleBufferedTexture*>::const_iterator it = textures.begin(); + for (; it != textures.end(); ++it) (*it)->release(this); } } |