Index: ui/ozone/gpu/gpu_memory_buffer_factory_ozone_native_buffer.cc |
diff --git a/ui/ozone/gpu/gpu_memory_buffer_factory_ozone_native_buffer.cc b/ui/ozone/gpu/gpu_memory_buffer_factory_ozone_native_buffer.cc |
index 38667e51e180f2d306fc50ec87e8994da9d88e1f..fe30e17ed0c09140f7d5b7798835631070f35311 100644 |
--- a/ui/ozone/gpu/gpu_memory_buffer_factory_ozone_native_buffer.cc |
+++ b/ui/ozone/gpu/gpu_memory_buffer_factory_ozone_native_buffer.cc |
@@ -166,7 +166,8 @@ GpuMemoryBufferFactoryOzoneNativeBuffer::CreateImageForGpuMemoryBuffer( |
gfx::GpuMemoryBuffer::Format format, |
unsigned internalformat, |
int client_id) { |
- NativePixmap* pixmap = nullptr; |
+ DCHECK(thread_checker_.CalledOnValidThread()); |
reveman
2015/04/07 13:07:05
ditto
dshwang
2015/04/07 14:04:26
ditto
|
+ scoped_refptr<NativePixmap> pixmap(nullptr); |
reveman
2015/04/07 13:07:05
what's wrong with the previous code?
dshwang
2015/04/07 14:04:26
nothing wrong. I'll roll back
|
{ |
base::AutoLock lock(native_pixmap_map_lock_); |
BufferToPixmapMap::iterator it = |
@@ -174,7 +175,7 @@ GpuMemoryBufferFactoryOzoneNativeBuffer::CreateImageForGpuMemoryBuffer( |
if (it == native_pixmap_map_.end()) { |
return scoped_refptr<gfx::GLImage>(); |
} |
- pixmap = it->second.get(); |
+ pixmap.swap(it->second); |
} |
return CreateImageForPixmap(pixmap, size, format, internalformat); |
} |