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

Unified Diff: google.patch

Issue 8574050: Remove 1 exit time destructor from our local changes to hunspell. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/deps/third_party/hunspell/
Patch Set: Created 9 years, 1 month 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 | src/hunspell/hashmgr.cxx » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: google.patch
===================================================================
--- google.patch (revision 96723)
+++ google.patch (working copy)
@@ -553,8 +553,9 @@
+ // This function is only ever called by one place and not nested. We can
+ // therefore keep static state between calls and use |col| as a "reset" flag
+ // to avoid changing the API. It is set to -1 for the first call.
-+ static hunspell::WordIterator word_iterator =
-+ bdict_reader->GetAllWordIterator();
++ // Allocate the iterator on the heap to prevent an exit time destructor.
++ static hunspell::WordIterator& word_iterator =
++ *new hunspell::WordIterator(bdict_reader->GetAllWordIterator());
+ if (col < 0) {
+ col = 1;
+ word_iterator = bdict_reader->GetAllWordIterator();
« no previous file with comments | « no previous file | src/hunspell/hashmgr.cxx » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698