Fix next browser ID value reset (issue #204).

git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@205 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
This commit is contained in:
Marshall Greenblatt 2011-03-22 23:11:26 +00:00
parent 27496a992a
commit c480b409cd
1 changed files with 9 additions and 3 deletions

View File

@ -15,6 +15,10 @@
#endif
#include "webkit/plugins/npapi/plugin_list.h"
// Both the CefContext constuctor and the CefContext::RemoveBrowser method need
// to initialize or reset to the same value.
const int kNextBrowserIdReset = 1;
// Global CefContext pointer
CefRefPtr<CefContext> _Context;
@ -234,9 +238,11 @@ bool CefCreateURL(const CefURLParts& parts,
// CefContext
CefContext::CefContext()
: initialized_(false), shutting_down_(false), current_webviewhost_(NULL)
: initialized_(false),
shutting_down_(false),
next_browser_id_(kNextBrowserIdReset),
current_webviewhost_(NULL)
{
}
CefContext::~CefContext()
@ -335,7 +341,7 @@ bool CefContext::RemoveBrowser(CefRefPtr<CefBrowserImpl> browser)
}
if (browserlist_.empty()) {
next_browser_id_ = 1;
next_browser_id_ = kNextBrowserIdReset;
empty = true;
}