| Index: cc/surfaces/surface_factory.cc
|
| diff --git a/cc/surfaces/surface_factory.cc b/cc/surfaces/surface_factory.cc
|
| index dcf1130c942b4dcefbbb0b34e39d85e4a9e869c5..88c54557cb4536f118b4b2eba687ddc765b495a3 100644
|
| --- a/cc/surfaces/surface_factory.cc
|
| +++ b/cc/surfaces/surface_factory.cc
|
| @@ -17,6 +17,17 @@ SurfaceFactory::SurfaceFactory(SurfaceManager* manager,
|
| }
|
|
|
| SurfaceFactory::~SurfaceFactory() {
|
| + if (!surface_map_.empty()) {
|
| + LOG(ERROR) << "SurfaceFactory has " << surface_map_.size()
|
| + << " entries in map on destruction.";
|
| + }
|
| + DestroyAll();
|
| +}
|
| +
|
| +void SurfaceFactory::DestroyAll() {
|
| + for (auto& surface : surface_map_)
|
| + manager_->DeregisterSurface(surface.first);
|
| + surface_map_.clear();
|
| }
|
|
|
| void SurfaceFactory::Create(SurfaceId surface_id, const gfx::Size& size) {
|
|
|