Attempt to fix orangeness - move the registration from Init() to CommonInit()

This commit is contained in:
rbs%maths.uq.edu.au 2001-11-20 22:57:07 +00:00
Родитель cbe5e79c3e
Коммит f2ddda81a2
1 изменённых файлов: 6 добавлений и 6 удалений

Просмотреть файл

@ -101,12 +101,6 @@ NS_IMETHODIMP DeviceContextImpl :: Init(nsNativeWidget aWidget)
CommonInit();
// register as a memory-pressure observer to free font resources
// in low-memory situations.
nsCOMPtr<nsIObserverService> obs(do_GetService("@mozilla.org/observer-service;1"));
if (obs)
obs->AddObserver(this, "memory-pressure", PR_FALSE);
return NS_OK;
}
@ -114,6 +108,12 @@ void DeviceContextImpl :: CommonInit(void)
{
for (PRInt32 cnt = 0; cnt < 256; cnt++)
mGammaTable[cnt] = cnt;
// register as a memory-pressure observer to free font resources
// in low-memory situations.
nsCOMPtr<nsIObserverService> obs(do_GetService("@mozilla.org/observer-service;1"));
if (obs)
obs->AddObserver(this, "memory-pressure", PR_FALSE);
}
NS_IMETHODIMP DeviceContextImpl :: GetTwipsToDevUnits(float &aTwipsToDevUnits) const