Index: content/child/child_shared_bitmap_manager.cc |
diff --git a/content/child/child_shared_bitmap_manager.cc b/content/child/child_shared_bitmap_manager.cc |
index 9dc86bd679b50880c1c0cee97278f0b3d8e59c90..aa9f1f37ba6dd854418aab8be314b2ece5d091c4 100644 |
--- a/content/child/child_shared_bitmap_manager.cc |
+++ b/content/child/child_shared_bitmap_manager.cc |
@@ -55,7 +55,13 @@ ChildSharedBitmapManager::~ChildSharedBitmapManager() {} |
scoped_ptr<cc::SharedBitmap> ChildSharedBitmapManager::AllocateSharedBitmap( |
const gfx::Size& size) { |
- return AllocateSharedMemoryBitmap(size); |
+ scoped_ptr<SharedMemoryBitmap> bitmap = AllocateSharedMemoryBitmap(size); |
+#if defined(OS_POSIX) |
+ // Close file descriptor to avoid running out. |
+ if (bitmap) |
+ bitmap->shared_memory()->Close(); |
+#endif |
+ return bitmap.Pass(); |
} |
scoped_ptr<SharedMemoryBitmap> |