diff options
-rw-r--r-- | app/surface/transport_dib.h | 3 | ||||
-rw-r--r-- | chrome/gpu/gpu_backing_store_glx.cc | 2 | ||||
-rw-r--r-- | chrome/gpu/gpu_backing_store_win.cc | 4 |
3 files changed, 5 insertions, 4 deletions
diff --git a/app/surface/transport_dib.h b/app/surface/transport_dib.h index ffa10e4..c392c5f 100644 --- a/app/surface/transport_dib.h +++ b/app/surface/transport_dib.h @@ -122,7 +122,8 @@ class TransportDIB { // renderer. static TransportDIB* Create(size_t size, uint32 sequence_num); - // Map the referenced transport DIB. Returns NULL on failure. + // Map the referenced transport DIB. The caller owns the returned object. + // Returns NULL on failure. static TransportDIB* Map(Handle transport_dib); // Returns true if the handle is valid. diff --git a/chrome/gpu/gpu_backing_store_glx.cc b/chrome/gpu/gpu_backing_store_glx.cc index 1c91a641..37076cc 100644 --- a/chrome/gpu/gpu_backing_store_glx.cc +++ b/chrome/gpu/gpu_backing_store_glx.cc @@ -63,7 +63,7 @@ void GpuBackingStoreGLX::OnPaintToBackingStore( TransportDIB::Id id, const gfx::Rect& bitmap_rect, const std::vector<gfx::Rect>& copy_rects) { - TransportDIB* dib = TransportDIB::Map(id); + scoped_ptr<TransportDIB> dib(TransportDIB::Map(id)); view_->BindContext(); scoped_ptr<skia::PlatformCanvas> canvas( diff --git a/chrome/gpu/gpu_backing_store_win.cc b/chrome/gpu/gpu_backing_store_win.cc index a38e8b9..d5af441 100644 --- a/chrome/gpu/gpu_backing_store_win.cc +++ b/chrome/gpu/gpu_backing_store_win.cc @@ -130,8 +130,8 @@ void GpuBackingStoreWin::OnPaintToBackingStore( HANDLE section = win_util::GetSectionFromProcess( id.handle, source_process_handle, false /* read write */); CHECK(section); - TransportDIB* dib = TransportDIB::Map(section); - CHECK(dib); + scoped_ptr<TransportDIB> dib(TransportDIB::Map(section)); + CHECK(dib.get()); if (!backing_store_dib_) { backing_store_dib_ = CreateDIB(hdc_, size_.width(), |