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

Unified Diff: chrome/browser/ui/views/omnibox/omnibox_view_win.cc

Issue 10826271: Fix a potential access violation in the destructor of OmniboxViewWin. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 4 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/views/omnibox/omnibox_view_win.cc
diff --git a/chrome/browser/ui/views/omnibox/omnibox_view_win.cc b/chrome/browser/ui/views/omnibox/omnibox_view_win.cc
index 1fecea8e197831826fa79f2b8a9ee6da9e60c26f..2d81c0d2748bc2f674bdc8c055e1b08408e68006 100644
--- a/chrome/browser/ui/views/omnibox/omnibox_view_win.cc
+++ b/chrome/browser/ui/views/omnibox/omnibox_view_win.cc
@@ -529,8 +529,10 @@ OmniboxViewWin::OmniboxViewWin(OmniboxEditController* controller,
OmniboxViewWin::~OmniboxViewWin() {
// Explicitly release the text object model now that we're done with it, and
// before we free the library. If the library gets unloaded before this
- // released, it becomes garbage.
- text_object_model_->Release();
+ // released, it becomes garbage. Note that since text_object_model_ is lazy
+ // initialized, it may still be null.
+ if (text_object_model_)
+ text_object_model_->Release();
// We balance our reference count and unpatch when the last instance has
// been destroyed. This prevents us from relying on the AtExit or static
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698