Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(49)

Unified Diff: webkit/glue/scoped_clipboard_writer_glue.cc

Issue 10078001: Fix leak in ScopedClipboardWriterGlue. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « webkit/glue/scoped_clipboard_writer_glue.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webkit/glue/scoped_clipboard_writer_glue.cc
diff --git a/webkit/glue/scoped_clipboard_writer_glue.cc b/webkit/glue/scoped_clipboard_writer_glue.cc
index e5ac21189fe2706663a400dce46118e9fcb8dc85..f648b7bf1c1b8ebd3d3e80170a89fc22b2337492 100644
--- a/webkit/glue/scoped_clipboard_writer_glue.cc
+++ b/webkit/glue/scoped_clipboard_writer_glue.cc
@@ -11,19 +11,19 @@ ScopedClipboardWriterGlue::ScopedClipboardWriterGlue(
ui::Clipboard::BUFFER_STANDARD),
context_(client->CreateWriteContext()) {
// We should never have an instance where both are set.
- DCHECK((clipboard_ && !context_) ||
- (!clipboard_ && context_));
+ DCHECK((clipboard_ && !context_.get()) ||
+ (!clipboard_ && context_.get()));
}
ScopedClipboardWriterGlue::~ScopedClipboardWriterGlue() {
- if (!objects_.empty() && context_) {
- context_->FlushAndDestroy(objects_);
+ if (!objects_.empty() && context_.get()) {
+ context_->Flush(objects_);
}
}
void ScopedClipboardWriterGlue::WriteBitmapFromPixels(const void* pixels,
const gfx::Size& size) {
- if (context_) {
+ if (context_.get()) {
context_->WriteBitmapFromPixels(&objects_, pixels, size);
} else {
ScopedClipboardWriter::WriteBitmapFromPixels(pixels, size);
« no previous file with comments | « webkit/glue/scoped_clipboard_writer_glue.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698