зеркало из https://github.com/mozilla/pjs.git
fix for prefwindow not being initialized if it's brought up at the wrong time.
thanks to Wen.Gong@eng.sun.com
This commit is contained in:
Родитель
0fabc7f050
Коммит
a843e8dd9f
|
@ -452,6 +452,20 @@ nsresult nsPrefWindow::InitializeWidgetsRecursive(nsIDOMNode* inParentNode)
|
|||
nsresult nsPrefWindow::InitializePrefWidgets()
|
||||
//----------------------------------------------------------------------------------------
|
||||
{
|
||||
// mPrefs is only initialized in nsPrefWindow::showWindow(), which
|
||||
// is not be called if we load preferences page (PrefsWindow.xul)
|
||||
// directly in the browser instead of going through the preference window
|
||||
// (menu Edit=>Preferences, or apprunner -pref). Without the initialization
|
||||
// here, browser crashes if we load PrefsWindow.xul in main window
|
||||
if (!mPrefs) {
|
||||
nsIPref* prefs = nsnull;
|
||||
nsresult rv = nsServiceManager::GetService(
|
||||
kPrefCID, nsIPref::GetIID(), (nsISupports**)&prefs);
|
||||
if (NS_FAILED(rv))
|
||||
return rv;
|
||||
mPrefs = prefs;
|
||||
}
|
||||
|
||||
NS_ASSERTION(mPanelFrame, "panel window is null");
|
||||
NS_ASSERTION(mPrefs, "prefs pointer is null");
|
||||
if (!mPanelFrame || !mPrefs)
|
||||
|
|
Загрузка…
Ссылка в новой задаче