Chromium Code Reviews| Index: chrome/browser/ui/views/uninstall_view.cc |
| diff --git a/chrome/browser/ui/views/uninstall_view.cc b/chrome/browser/ui/views/uninstall_view.cc |
| index 5b5fa83f407afd290ea296a32036cd159c4b444f..96ae4227bbb01b91e9fdd72c6ab2c7c379bc8054 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(); |
|
sky
2013/05/16 19:26:50
How does the ref count end up hitting 0 here?
|
| + |
| base::RunLoop run_loop(&accelerator_handler); |
| UninstallView* view = new UninstallView(&result, |
| run_loop.QuitClosure(), |