diff options
-rw-r--r-- | chrome/browser/ui/views/uninstall_view.cc | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/chrome/browser/ui/views/uninstall_view.cc b/chrome/browser/ui/views/uninstall_view.cc index 5b5fa83..96ae422 100644 --- a/chrome/browser/ui/views/uninstall_view.cc +++ b/chrome/browser/ui/views/uninstall_view.cc @@ -7,6 +7,7 @@ #include "base/message_loop.h" #include "base/process_util.h" #include "base/run_loop.h" +#include "chrome/browser/browser_process.h" #include "chrome/browser/shell_integration.h" #include "chrome/browser/ui/uninstall_browser_prompt.h" #include "chrome/common/chrome_result_codes.h" @@ -166,6 +167,16 @@ int ShowUninstallBrowserPrompt(bool show_delete_profile) { DCHECK_EQ(base::MessageLoop::TYPE_UI, base::MessageLoop::current()->type()); int result = content::RESULT_CODE_NORMAL_EXIT; views::AcceleratorHandler accelerator_handler; + + // Take a reference on g_browser_process while showing the dialog. This is + // done because the dialog uses the views framework which may increment + // and decrement the module ref count during the course of displaying UI and + // this code can be called while the module refcount is still at 0. + // Note that this reference is never released, as this code is shown on a path + // that immediately exits Chrome anyway. + // See http://crbug.com/241366 for details. + g_browser_process->AddRefModule(); + base::RunLoop run_loop(&accelerator_handler); UninstallView* view = new UninstallView(&result, run_loop.QuitClosure(), |