Index: chrome/browser/chromeos/input_method/candidate_window.cc |
diff --git a/chrome/browser/chromeos/input_method/candidate_window.cc b/chrome/browser/chromeos/input_method/candidate_window.cc |
index 46ee983e73b9825a29b388eba864dcf7df9e0ffa..8d66df33505c284e05b75a7ad5b147d862475fab 100644 |
--- a/chrome/browser/chromeos/input_method/candidate_window.cc |
+++ b/chrome/browser/chromeos/input_method/candidate_window.cc |
@@ -10,6 +10,7 @@ |
#include "base/logging.h" |
#include "base/memory/scoped_ptr.h" |
+#include "base/message_loop.h" |
#include "base/observer_list.h" |
#include "base/string_util.h" |
#include "base/stringprintf.h" |
@@ -1048,6 +1049,8 @@ void CandidateWindowView::MaybeInitializeCandidateViews( |
// Clear the existing candidate_views if any. |
for (size_t i = 0; i < candidate_views_.size(); ++i) { |
candidate_area_contents->RemoveChildView(candidate_views_[i]); |
+ // Delete the view after getting out the current message loop iteration. |
+ MessageLoop::current()->DeleteSoon(FROM_HERE, candidate_views_[i]); |
} |
candidate_views_.clear(); |