From c480b409cdf653c3385201889e9a4051e989e042 Mon Sep 17 00:00:00 2001 From: Marshall Greenblatt Date: Tue, 22 Mar 2011 23:11:26 +0000 Subject: [PATCH] Fix next browser ID value reset (issue #204). git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@205 5089003a-bbd8-11dd-ad1f-f1f9622dbc98 --- libcef/cef_context.cc | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/libcef/cef_context.cc b/libcef/cef_context.cc index 8c5f05365..aa6bca8c8 100644 --- a/libcef/cef_context.cc +++ b/libcef/cef_context.cc @@ -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 _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 browser) } if (browserlist_.empty()) { - next_browser_id_ = 1; + next_browser_id_ = kNextBrowserIdReset; empty = true; }